Take-Home Exercise 03: Prototyping Modules for Geospatial Analytics Shiny Application

r
shiny
Author
Published

March 10, 2024

Modified

March 24, 2024

Prototyping Modules for Geospatial Analytics Shiny Application

1.0 Overview

In the realm of application development, prototyping serves as a powerful tool that breathes life into abstract concepts and ideas, transforming them into tangible representations. It is akin to a bridge that connects the realm of theoretical design with the practical world of user interaction.

A prototype, particularly for an application, is primarily a tool for validating design. It provides a platform to test and verify whether the visual elements and user experience (UX) of the application resonate with stakeholders and potential users. This process is crucial as it allows for the refinement of the application’s UX before further resources are committed, thereby ensuring efficiency and effectiveness in the development process.

1.1 Prototyping for Shiny Application

In the context of developing a Shiny application with R, prototyping takes on a more specific role. It involves evaluating and determining the necessary R packages that are supported in R CRAN, which forms the backbone of the application. This step ensures that the application is built on a solid and reliable foundation.

Furthermore, prototyping involves preparing and testing specific R codes to ensure they run correctly and return the expected output. This step is akin to a rehearsal before the actual performance, ensuring that the final product runs smoothly and meets the desired objectives.

Another critical aspect of prototyping in Shiny application development is determining the parameters and outputs that will be exposed on the Shiny applications. This process is like setting the stage for user interaction, deciding what the users see and how they interact with the application.

Lastly, prototyping involves selecting the appropriate Shiny UI components for exposing the parameters determined above. This step is where the application starts to take shape, and the user interface begins to reflect the application’s functionality and purpose.

In essence, prototyping is a journey of transformation, from abstract ideas to a functional application, ensuring that the final product not only meets design specifications but also provides an engaging and satisfactory user experience. It is the lighthouse that guides the application development process, ensuring that the final product is not just a mere application, but a solution that meets the needs of its users.

This exercise is designed as a comprehensive walk-through of the prototyping process for a Shiny application. It will guide you through each step, starting from the basics of Shiny, moving on to the ideation of a generic design, followed by the analysis of R-packages and testing of R codes, which all will contribute to the proposed storyboard of our Shiny application.

2.0 Understanding Basics of Shiny

Shiny is an open-source R package that provides a powerful web framework for building interactive web applications using R. The best part? We don’t need to dive into all that web design jargon like HTML, CSS, or JavaScript. We just focus on our R analysis, and Shiny turns it into a web app that others can play around with.

2.1 Basic Building Blocks of Shiny

When we’re working with Shiny, we basically have a folder that contains an R script named app.R. This script is the heart of our Shiny application. It’s made up of two main parts: a user interface ui object and a server function.

One of the cool things about Shiny is that it lets us keep our ui object and server function separate. This means we can clearly split up the code that creates our user interface (that’s the front end, what our users see and interact with) from the code that decides how our application behaves (that’s the back end, the behind-the-scenes stuff). It’s like having a clean, organized workspace, which makes our job a whole lot easier!

2.2 UI

When we’re building a Shiny application, we work with three main components headerPanel, sidebarPanel, and mainPanel. These are the building blocks for our app’s user-interface.

  • Sidebar Panel (sidebarPanel): This is a vertical panel on the side of the application. It is displayed with a distinct background color and typically contains input controls.

  • Main Panel (mainPanel): This is the primary area of the application and it typically contains outputs. The main panel displays the output (like maps, plots, tables, etc.) based on the input given in the sidebar panel.

  • Header Panel (headerPanel): This is the topmost part of the UI where you can place the title of our application. It is not always necessary but can be used to provide a title or brief description of our application.

Grid Layout System: FluidRow and Column

When we’re designing the layout of our Shiny app, we get to play around with two functions fluidRow() and column(). Rows are created using the fluidRow() function. Within these rows, we can add columns - but a thing to note here is that columns can only be included within a row. We can define columns using the column() function. The width of these columns is based on the Bootstrap 12-wide grid system. This means we can have up to 12 columns in a single row, giving us a lot of flexibility in how we want to arrange things.

By playing around with fluidRow() and column(), we can create a wide variety of layouts. A few examples of different layout grids can be seen below:

Header Panel: Navbar Pages

To create a Shiny application that consists of multiple distinct sub-components (each with their own sidebar, tabsets, or other layout constructs), Shiny provides navbarPage() function to create subsection pages within a single Shiny application. So, no matter how complex our app gets, navbarPage() helps us keep things organized and user-friendly.

Main Panel: Outputs

In our Shiny app, we can create placeholders in the main panel for outputs. These are later filled in by the server function, which translates our inputs into outputs. There are three main types of output, which correspond to the three things we usually include in a report: text, tables, and plots. Shiny provides functions like textOutput(), tableOutput(), and plotOutput() to define output elements and renderText(), renderTable() and renderPlot() to render and create output elements on user interface. Using fluidRow() and column(), configurations of the output elements can be customised as well.

Main Panel: Tabsets

Shiny provides tabsetPanel() function that allows us to subdivide the main panel into multiple sections. Each section can then show different outputs. It’s like having different tabs in a browser, each showing a different webpage. This way, we can keep our outputs neat and organized, and our users can easily find what they’re looking for.

2.3 Server

In a Shiny application, the server component is responsible for the server-side logic of our application. The server object can include one or more functions that take the inputs from our ui object and turn them into outputs. A server function usually take in an input and an output parameter. The input parameter allows the server to access the UI inputs, and the output parameter is used to define how to display outputs on the UI. An optional parameter session can also be inputted to define the session-related logic to the application.

So, how do the u and server interact to run the app? Well, imagine it like a two-way street. The ui sends the inputs to the server, and the server sends back the outputs to be displayed on the ui. It’s a continuous loop of interaction that keeps our app running smoothly. A generi diagram of how they interact to run the application has been formulated below:

In actual fact, there are multiple customisation and extensions available in Shiny to improve the look and feel of our application. However, I only covered basic components and certain customisations from my research that I intend to use in my proposed design.

3.0 Analysing R-Packages

There are multiple R-packages available

pacman::p_load(tmap, sf, sp, tidyverse, knitr, spflow, Matrix, performance)

4.0 Testing Spatial Interaction Modelling

First, import three datasets

  • flow_data_merged contains the origin-destination flow data of public bus trajectories for three months (November, December, and January)

  • od_data_merged contains the origin-destination pair of bus stops within Singapore and the associated intra-region, and inter-regional flow

  • hex_grid_pa_sz contains the analytical hexagon division of Singapore for spatial interaction modelling, with geometric data, associated subzone and planning area of each hexagon.

flow_data_merged <- read_rds("~/IS415-GAA/Take-home_Ex/Take-home_Ex03/data/flow_data_merged.rds")
od_data_merged <- read_rds("~/IS415-GAA/Take-home_Ex/Take-home_Ex03/data/od_data.rds")
hex_grid_pa_sz <- read_rds("~/IS415-GAA/Take-home_Ex/Take-home_Ex03/data/hex_grid_pa.rds")

4.1 Creating Outflow Map

In this section, we will create outflow map for each hexagon. This map will serve as a visual representation of the total count of outflow movement of people from each hexagon to others.

Our original dataset is quite large, encompassing a vast amount of data. However, for the purpose of prototyping, we will be utilizing only a fragment of this data. This approach allows us to test the functionality of various R packages and assess the types of visualizations and analytical outcomes that can be produced without exhausting computational resources.

For this purpose, I filter the data where DAY_TYPE is “WEEKDAY” and TIME_PER_HOUR is 8, which represents 8 AM in the morning. the resultant data stored as flow_data_weekday_morn. This filtered data, stored as flow_data_weekday_morn, will be used for subsequent map creations.

flow_data_weekday_morn <- flow_data_merged %>% filter(DAY_TYPE == "WEEKDAY", TIME_PER_HOUR %in% c(8))

In our dataset, each origin-destination trajectory is represented as individual row. For map creation, we will aggregate the total trips by origin hexagon. This gives us a summary of the total trips that originated from each hexagon - hence providing outflow volume.

outflow_data_weekday_morn <- aggregate(flow_data_weekday_morn$TOTAL_TRIPS, by=list(Category=flow_data_weekday_morn$ORIGIN_hex), FUN=sum)

colnames(outflow_data_weekday_morn) <- c("index", "TOTAL_TRIPS")

The newly aggregated dataset that we have is of the data.frame type. While this format is useful for many types of data analysis, it is not directly compatible with mapping functions. Therefore, to facilitate the creation of our outflow maps, we need to join this dataset with the spatial features object hex_grid_pa_sz which is of the sf (simple features) type.

To accomplish this, we will use the left_join() function from the dplyr package in R. The left_join() function merges two datasets together based on a common column. In our case, this common column is the index column. This will result in a new sf object called outflow_data_weekday_morn_hex that contains both the outflow data and the corresponding spatial data for each hexagon.

outflow_data_weekday_morn_hex <- left_join(hex_grid_pa_sz, outflow_data_weekday_morn, by = 'index')

It’s crucial to understand that not every hexagon may have an aggregated value, especially considering that we are working with a subset of the original dataset. To address it, any NA values in the TOTAL_TRIPS column of the outflow_data_weekday_morn_hex data frame will be replaced with 0.

outflow_data_weekday_morn_hex$TOTAL_TRIPS <- ifelse(is.na(outflow_data_weekday_morn_hex$TOTAL_TRIPS), 0, outflow_data_weekday_morn_hex$TOTAL_TRIPS)

Finally we can prepare the outflow map using the appropriate tmap functions.

tmap_mode("view")
tm_shape(outflow_data_weekday_morn_hex) +
  tm_fill(col = "TOTAL_TRIPS",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Outflow Trip Count",
          id = "TOTAL_TRIPS") +
  tm_borders(col = "grey")
Reflection

Prototyping Thoughts

Notably, style argument is set to “fixed”. This means that the color breaks are manually specified and breaks argument specifies the boundaries (flow volume count) for the color breaks.

I choose to manually specify these color breaks because it helps the users to have a consistent interpretation of the colors across different maps. By using the same color breaks, I ensure that the same range of data values corresponds to the same color on all my maps. This makes it easier for the users to compare maps and understand trends and patterns. For instance, if one color represents a range of 0-10 on one map and 0-20 on another, it would be difficult to make easy and accurate comparisons between the two maps. By using fixed color breaks, I eliminate this issue and make my maps more intuitive and user-friendly.

4.2 Making Inflow Map

Similar to what we did for outflow map, we will follow the same process for inflow map as well. Instead of aggregating the data by original hexagon ORIGIN_hex, we will use DESTIN_hex this time, so that we aggregate the total of inflow movement into each hexagon.

inflow_data_weekday_morn <- aggregate(flow_data_weekday_morn$TOTAL_TRIPS, by=list(Category=flow_data_weekday_morn$DESTIN_hex), FUN=sum)

colnames(inflow_data_weekday_morn) <- c("index", "TOTAL_TRIPS")

After aggregation, we implement left_join() with hex_grid_pa_sz and then replace the NULL values with 0.

inflow_data_weekday_morn_hex <- left_join(hex_grid_pa_sz, inflow_data_weekday_morn, by = 'index')

inflow_data_weekday_morn_hex$TOTAL_TRIPS <- ifelse(is.na(inflow_data_weekday_morn_hex$TOTAL_TRIPS), 0, inflow_data_weekday_morn_hex$TOTAL_TRIPS)

Finally we can prepare the inflow map using the appropriate tmap functions.

tmap_mode("view")
tm_shape(inflow_data_weekday_morn_hex) +
  tm_fill(col = "TOTAL_TRIPS",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Inflow Trip Count",
          id = "TOTAL_TRIPS")+
  tm_borders(col = "grey")+
  tm_layout(legend.title.size = 1,
            legend.text.size = 0.6,
            frame = TRUE)

4.3 Making Distribution Graphs

Another visualisation that can be produced to support the maps created above is a distribution graph. Although the map provides the specifica spatial patterns of the flow volumes, it is not striaghtforward to discent the distribution. In this regards, we will create distribution graphs to supplement the maps.

Reflection

Prototyping Thoughts

When I create distribution graphs to accompany and supplement my maps, I believe it’s of utmost importance to maintain a consistent representation. To achieve this, I’ll create the histograms using the breaks I specified in the maps as bins and use the same color palette. Essentially, I want users to look at the maps and histograms together and receive a consistent message. This way, they can easily interpret the information and understand the patterns I’m trying to highlight.

Here, we will define the breaks, labels and color_map for our distribution graphs. We use the consistent language with the breaks and labels and consistent color palette from the previous overall SIngapore map.

breaks <- c(0,0.9,100,1000,10000,100000,500000,1000000,5000000)
labels <- c("0", "1 to 100", "100 to 1,000", "1,000 to 10,000", "10,000 to 100,000", "100,000 to 500,00", "500,000 to 1,000,000", "1,000,000 to 5,000,000")
colors = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0")
color_map = setNames(colors, labels)

Outflow Distribution Graph

Using the breaks and labels, we will create a new data column called TRIPS_BIN which categorizes the TOTAL_TRIPS into different bins based on the breaks we defined earlier.

outflow_data_weekday_morn_hex$TRIPS_BIN <- cut(outflow_data_weekday_morn_hex$TOTAL_TRIPS, breaks = breaks, labels=labels, include.lowest = TRUE, right = FALSE)
head(outflow_data_weekday_morn_hex)
Simple feature collection with 6 features and 5 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: 2292.538 ymin: 21664.98 xmax: 3417.538 ymax: 28376.68
Projected CRS: SVY21 / Singapore TM
  PLN_AREA_N           SUBZONE_N index TOTAL_TRIPS
1       TUAS TUAS VIEW EXTENSION     1           0
2       TUAS TUAS VIEW EXTENSION     2           0
3       TUAS TUAS VIEW EXTENSION     3           0
4       TUAS TUAS VIEW EXTENSION     4           0
5       TUAS TUAS VIEW EXTENSION     5           0
6       TUAS TUAS VIEW EXTENSION     6           0
                        geometry TRIPS_BIN
1 POLYGON ((2667.538 22314.5,...         0
2 POLYGON ((2667.538 23613.54...         0
3 POLYGON ((2667.538 24912.58...         0
4 POLYGON ((2667.538 26211.61...         0
5 POLYGON ((2667.538 27510.65...         0
6 POLYGON ((3042.538 21664.98...         0

Next, we will create distribution graph for outflow map using relevant ggplot2 functions.

ggplot(data = outflow_data_weekday_morn_hex,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Outflow Trip Count") +  
  scale_fill_manual(values=color_map) +
  ggtitle("Distribution of Hexagons Per Each Outflow Trip Count Bin")

Reflection

Prototyping Thoughts

Looking at the graphs above, I noticed that the number of hexagons with zero flow volume significantly outweighs the overall distribution. This makes the differences in other categories appear less significant. To address this, I decided to create a new graph where I exclude the hexagons with zero outflow trips. This will allow me to focus on the hexagons with non-zero outflow trips and gain a better understanding of their distribution.

outflow_data_weekday_morn_nozero <- outflow_data_weekday_morn_hex %>% filter(TOTAL_TRIPS != 0)

Next, we will create distribution graph for outflow map using relevant ggplot2 functions.

ggplot(data = outflow_data_weekday_morn_nozero,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Outflow Trip Count") +  
  scale_fill_manual(values=color_map)+
  ggtitle("Distribution of Hexagons Per Each Outflow Trip Count Bin", 
          subtitle = "(excluding hexagons with zero outflow trip)")

Inflow Distribution Graph

We will repeat the same procedures for inflow distribution graphs as well.

inflow_data_weekday_morn_hex$TRIPS_BIN <- cut(inflow_data_weekday_morn_hex$TOTAL_TRIPS, breaks = breaks, labels=labels, include.lowest = TRUE, right = FALSE)
head(inflow_data_weekday_morn_hex)
Simple feature collection with 6 features and 5 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: 2292.538 ymin: 21664.98 xmax: 3417.538 ymax: 28376.68
Projected CRS: SVY21 / Singapore TM
  PLN_AREA_N           SUBZONE_N index TOTAL_TRIPS
1       TUAS TUAS VIEW EXTENSION     1           0
2       TUAS TUAS VIEW EXTENSION     2           0
3       TUAS TUAS VIEW EXTENSION     3           0
4       TUAS TUAS VIEW EXTENSION     4           0
5       TUAS TUAS VIEW EXTENSION     5           0
6       TUAS TUAS VIEW EXTENSION     6           0
                        geometry TRIPS_BIN
1 POLYGON ((2667.538 22314.5,...         0
2 POLYGON ((2667.538 23613.54...         0
3 POLYGON ((2667.538 24912.58...         0
4 POLYGON ((2667.538 26211.61...         0
5 POLYGON ((2667.538 27510.65...         0
6 POLYGON ((3042.538 21664.98...         0
ggplot(data = inflow_data_weekday_morn_hex,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Inflow Trip Count") +  
  scale_fill_manual(values=color_map) +
  ggtitle("Distribution of Hexagons Per Each Inflow Trip Count Bin")

inflow_data_weekday_morn_nozero <- inflow_data_weekday_morn_hex %>% filter(TOTAL_TRIPS != 0)
ggplot(data = inflow_data_weekday_morn_nozero,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Inflow Trip Count") +  
  scale_fill_manual(values=color_map)+
  ggtitle("Distribution of Hexagons Per Each Inflow Trip Count Bin", 
          subtitle = "(excluding hexagons with zero inflow trip)")

4.4 Zooming into Planning Areas and Subzones

In this section, we will further zoom our inflow/outflow map into planning areas and subzones.

Reflection

Prototyping Thougths

In the previous section, my focus was on exploring the inflow and outflow maps for the entirety of Singapore Island. However, I realized that this broad perspective might not be intuitive enough to identify patterns at the local subzone levels.

Especially when we’re using analytical hexagons to represent the spatial units, it can pose a real challenge for users to understand the local details. For instance, figuring out which planning area or subzone a hexagon belongs to, or simply pinpointing a planning area or subzone’s location in Singapore, can be quite tricky.

Considering this, I thought of a potential enhancement to the user experience. What if I could allow users to specify the subzone they’re interested in? This way, they could delve into the details of that particular area, examining the inflow and outflow patterns more closely. Not only would this make the data more relevant and personalized for the user, but it could also reveal unique patterns and trends that might be overlooked in a broader analysis.

Before we go about testing, let’s have a quick look at how the structure of our inflow and outflow dataset looks like.

head(inflow_data_weekday_morn_hex)
Simple feature collection with 6 features and 5 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: 2292.538 ymin: 21664.98 xmax: 3417.538 ymax: 28376.68
Projected CRS: SVY21 / Singapore TM
  PLN_AREA_N           SUBZONE_N index TOTAL_TRIPS
1       TUAS TUAS VIEW EXTENSION     1           0
2       TUAS TUAS VIEW EXTENSION     2           0
3       TUAS TUAS VIEW EXTENSION     3           0
4       TUAS TUAS VIEW EXTENSION     4           0
5       TUAS TUAS VIEW EXTENSION     5           0
6       TUAS TUAS VIEW EXTENSION     6           0
                        geometry TRIPS_BIN
1 POLYGON ((2667.538 22314.5,...         0
2 POLYGON ((2667.538 23613.54...         0
3 POLYGON ((2667.538 24912.58...         0
4 POLYGON ((2667.538 26211.61...         0
5 POLYGON ((2667.538 27510.65...         0
6 POLYGON ((3042.538 21664.98...         0

From the look of it, it appears that each hexagon has data on their respective planning area and subzone they belong to. This information will be useful when we want to create planning-area specific maps for inflow/outflow. We can simply filter our dataset to smaller, temporary data based on the user specification.

4.4.1 Planning Area Level Zooming

Firsly, let’s try creating inflow/outflow maps for planning area level. The user can specify a planning area, and we can filter the data accordingly before creating maps. We will create two functions, called inflow_pa_map and outflow_pa_map. Each function is designed to generate a specific type of map - inflow or outflow, respectively.

When a planning area name is provided as input to these functions, they will filter the dataset to only include data relevant to the specified area. Leveraging the tmap package, these functions will then create an interactive map. It’s important to note that these maps will maintain the same color palette and breaks as our previous overall maps, ensuring consistency in our visual representations.

inflow_pa_map <- function(pa_input) { 
  inflow_pa_temp <- inflow_data_weekday_morn_hex %>% filter(PLN_AREA_N == pa_input)
  tmap_mode("view")
  tm_shape(inflow_pa_temp) +
    tm_fill(col = "TOTAL_TRIPS",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Inflow Trip Count",
          id= "TOTAL_TRIPS")+
  tm_borders(col = "grey")
}
outflow_pa_map <- function(pa_input) { 
  outflow_pa_temp <- outflow_data_weekday_morn_hex %>% filter(PLN_AREA_N == pa_input)
  tmap_mode("view")
  tm_shape(outflow_pa_temp) +
    tm_fill(col = "TOTAL_TRIPS",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Outflow Trip Count",
          id= "TOTAL_TRIPS")+
  tm_borders(col = "grey")
}

As a demonstration, we call the inflow_pa_map() function with “HOUGANG” and the outflow_pa_map() function with “BUKIT PANJANG” as inputs. to test whether the functions works well and produce desired outcomes.

inflow_pa_map("HOUGANG")
outflow_pa_map("BUKIT PANJANG")

In the similar vein, we will also need to update our distribution graphs to specific planning area. To achieve that, we will create four functions below - inflow_pa_graph, outflow_pa_graph , inflow_pa_nozerograph and outflow_pa_nozerograph .

inflow_pa_graph <- function(pa_input) { 
    inflow_pa_temp <- inflow_data_weekday_morn_hex %>% filter(PLN_AREA_N == pa_input)
  ggplot(data = inflow_pa_temp,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Inflow Trip Count") +  
  scale_fill_manual(values=color_map) +
  ggtitle("Distribution of Hexagons Per Each Inflow Trip Count Bin")
}

outflow_pa_graph <- function(pa_input) { 
    outflow_pa_temp <- outflow_data_weekday_morn_hex %>% filter(PLN_AREA_N == pa_input)
    ggplot(data = outflow_pa_temp,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Outflow Trip Count") +  
  scale_fill_manual(values=color_map) +
  ggtitle("Distribution of Hexagons Per Each Outflow Trip Count Bin")
}

inflow_pa_nozerograph <- function(pa_input) { 
    inflow_pa_temp_nozero <- inflow_data_weekday_morn_hex %>% filter(PLN_AREA_N == pa_input, TOTAL_TRIPS != 0)
  ggplot(data = inflow_pa_temp_nozero,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Inflow Trip Count") +  
  scale_fill_manual(values=color_map)+
  ggtitle("Distribution of Hexagons Per Each Inflow Trip Count Bin", 
          subtitle = "(excluding hexagons with zero inflow trip)")
}

outflow_pa_nozerograph <- function(pa_input) { 
    outflow_pa_temp_nozero <- outflow_data_weekday_morn_hex %>% filter(PLN_AREA_N == pa_input, TOTAL_TRIPS != 0)
  ggplot(data = outflow_pa_temp_nozero,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Outflow Trip Count") +  
  scale_fill_manual(values=color_map)+
  ggtitle("Distribution of Hexagons Per Each Outflow Trip Count Bin", 
          subtitle = "(excluding hexagons with zero outflow trip)")
}

As a demonstration, we call the inflow_pa_graph() & inflow_pa_nozerograph() functions with “HOUGANG” and the outflow_pa_graph() & outflow_pa_nozerograph() functions with “BUKIT PANJANG” as inputs to test whether the functions works well and produce desired outcomes.

inflow_pa_graph("HOUGANG")

inflow_pa_nozerograph("HOUGANG")

outflow_pa_graph("BUKIT PANJANG")

outflow_pa_nozerograph("BUKIT PANJANG")

4.4.2 Subzone Level Zooming

Similar to what we did with planning area level zooming, we can create functions for inflow/outflow maps at subzone level. Below, we have create two functions inflow_sz_map() and outflow_sz_map() using similar approach.

inflow_sz_map <- function(sz_input) { 
  inflow_sz_temp <- inflow_data_weekday_morn_hex %>% filter(SUBZONE_N == sz_input)
  tmap_mode("view")
  tm <- tm_shape(inflow_sz_temp) +
    tm_fill(col = "TOTAL_TRIPS",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Inflow Trip Count",
          id= "TOTAL_TRIPS")+
  tm_borders(col = "grey")
 return(tm)
}
outflow_sz_map <- function(sz_input) { 
  outflow_sz_temp <- outflow_data_weekday_morn_hex %>% filter(SUBZONE_N == sz_input)
  tmap_mode("view")
  tm <- tm_shape(outflow_sz_temp) +
    tm_fill(col = "TOTAL_TRIPS",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Outflow Trip Count",
          id= "TOTAL_TRIPS")+
  tm_borders(col = "grey")
 return(tm)
}

As a demonstration, we call the inflow_sz_map() function with “CHANGI AIRPORT” and the outflow_sz_map() function with “TUAS NORTH” as inputs to test whether the functions works well and produce desired outcomes.

inflow_sz_map("CHANGI AIRPORT")
outflow_sz_map("TUAS NORTH")

In the similar vein, we will also need to update our distribution graphs to specific subzone. To achieve that, we will create four functions below - inflow_sz_graph, outflow_sz_graph , inflow_sz_nozerograph and outflow_sz_nozerograph .

inflow_sz_graph <- function(sz_input) { 
    inflow_sz_temp <- inflow_data_weekday_morn_hex %>% filter(SUBZONE_N == sz_input)
  ggplot(data = inflow_sz_temp,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Inflow Trip Count") +  
  scale_fill_manual(values=color_map) +
  ggtitle("Distribution of Hexagons Per Each Inflow Trip Count Bin")
}

outflow_sz_graph <- function(sz_input) { 
    outflow_sz_temp <- outflow_data_weekday_morn_hex %>% filter(SUBZONE_N == sz_input)
    ggplot(data = outflow_sz_temp,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Outflow Trip Count") +  
  scale_fill_manual(values=color_map) +
  ggtitle("Distribution of Hexagons Per Each Outflow Trip Count Bin")
}

inflow_sz_nozerograph <- function(sz_input) { 
    inflow_sz_temp_nozero <- inflow_data_weekday_morn_hex %>% filter(SUBZONE_N == sz_input, TOTAL_TRIPS != 0)
  ggplot(data = inflow_sz_temp_nozero,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Inflow Trip Count") +  
  scale_fill_manual(values=color_map)+
  ggtitle("Distribution of Hexagons Per Each Inflow Trip Count Bin", 
          subtitle = "(excluding hexagons with zero inflow trip)")
}

outflow_sz_nozerograph <- function(sz_input) { 
    outflow_sz_temp_nozero <- outflow_data_weekday_morn_hex %>% filter(SUBZONE_N == sz_input, TOTAL_TRIPS != 0)
  ggplot(data = outflow_sz_temp_nozero,
       aes(y = TRIPS_BIN,fill = TRIPS_BIN)) +
  geom_bar(show.legend = FALSE)+
  xlab("Count of Analytical Hexagons") +
  ylab("Outflow Trip Count") +  
  scale_fill_manual(values=color_map)+
  ggtitle("Distribution of Hexagons Per Each Outflow Trip Count Bin", 
          subtitle = "(excluding hexagons with zero outflow trip)")
}

As a demonstration, we call the inflow_sz_graph() & inflow_sz_nozerograph() functions with “CHANGI AIRPORT” and the outflow_sz_graph() & outflow_sz_nozerograph() functions with “TUAS NORTH” as inputs to test whether the functions works well and produce desired outcomes.

inflow_sz_graph("CHANGI AIRPORT")

inflow_sz_nozerograph("CHANGI AIRPORT")

outflow_sz_graph("TUAS NORTH")

outflow_sz_nozerograph("TUAS NORTH")

4.5 Exploring User Input Options for Shiny Application

From the exercise above, we may include the following user specification and model calibration options for our Shiny application.

Input Options
Flow Type Incoming Flow, Outgoing Flow
Time Period Weekday - Morning Peak , Weekday - Evening Peak, Weekend/Holiday - Morning Peak, Weekend/Holiday - Evening Peak
Zooming Level Overall (Singapore) , Planning Area, Subzone
Area of Interest
  • NA if Overall (Singapore) is selected for Zooming Level

  • Planning Area Name if Planning Area is selected for Zooming Level

  • Subzone Name if Subzone is selected for Zooming Level

Reflection

Prototyping Thoughts

Initially, I had planned to use a slider for the time period, allowing users to specify the specific range of hours they wanted to examine. This seemed like the most viable approach. However, I soon realized that this could lead to heavy computation, especially if a user selected a very wide range (or possibly the entire dataset). This could potentially slow down our Shiny application, which would not be ideal for the user experience.

After some thought, I decided to switch to pre-determined time intervals, specifically focusing on morning and evening peak hours. While it’s still important to consider non-peak hours, I’ve noticed that most policy discussions around transport modeling tend to emphasize peak hours. Therefore, I believe it’s more useful and logical to focus on these peak periods.

For the morning peak, I plan to use the time from 6-8 AM, and for the evening peak, I intend to use 5-7 PM. This way, we can analyze the inflow and outflow patterns during the most critical hours of the day, providing valuable insights for transportation planning and policy making.

Below is a rough outline of how the user interface for this tabset might look like.

4.6 Spatial Interaction Modelling

In this section, we will test how we can implement and visualise spatial interaction modelling of origin-destination public bus flow data. In particular, we are planning to test using glm() functions from stats package to fit generalised linear models.

Applying log() Transformation to Explanatory Variables

Poisson regression is often used in spatial interaction modelling of origin-destination (OD) bus flow due to the nature of the data and the statistical properties of the Poisson distribution. Since Poisson Regression is based on log, log transformation of explanatory variables need to be done before running the model.

Hence, we apply log transformation to all columns in the flow dataset which ends with _count. These columns represent the explanatory variables of origin and destination hexagons in our dataset. We intuitively know that these variables need to be transformed because they are count data, which are often skewed and can benefit from a log transformation to meet the assumptions of Poisson regression. We also apply a log transformation to the dist column, which represents the distance between hexagons. This is done because distance is a continuous variable that can also be skewed and can benefit from a log transformation.

flow_data_weekday_morn_log <- flow_data_weekday_morn %>%
  mutate_at(vars(ends_with("_count")), log) %>%
  mutate(dist = log(dist))

The transformed data is stored in a new data frame flow_data_weekday_morn_log. This data frame is now ready for Poisson regression analysis.

4.7 Origin (Production) Constrained Spatial Interaction Model

In this section, we will fit an origin constrained Spatial Interaction Model (SIM). For origin constrained SIM, only explanatory variables representing the attractiveness at the destinations will be used. This is because such models emphasize the limitations or capacities of the origins rather than the demand or attractiveness of the destinations. The capacity or limitation at the origin sites determines the potential for generating interactions or flows.

orcSIM_weekday_morn <- glm(TOTAL_TRIPS ~ ORIGIN_hex + d_biz_count + d_school_count + d_fin_count + d_hc_count + d_busstop_count + d_housing_count + d_leisure_recre_count + d_retail_count + d_entertn_count + d_food_bev_count + dist - 1,
              family = poisson(link = "log"),
              data = flow_data_weekday_morn_log,
              na.action = na.exclude)

In the formula argument, we specify our response variable TOTAL_TRIPS and our explanatory variables. The explanatory variables include ORIGIN_hex, various destination counts (e.g., d_biz_count, d_school_count, etc.), and dist. The -1 at the end of the formula is used to remove the intercept that is inserted by glm into the model by default. Since the origin has already been constrained, the concept of an intercept would not be relevant.

We will have a look at the results of the origin constrained spatial interaction model that we have just fitted.

orcSIM_weekday_morn

Call:  glm(formula = TOTAL_TRIPS ~ ORIGIN_hex + d_biz_count + d_school_count + 
    d_fin_count + d_hc_count + d_busstop_count + d_housing_count + 
    d_leisure_recre_count + d_retail_count + d_entertn_count + 
    d_food_bev_count + dist - 1, family = poisson(link = "log"), 
    data = flow_data_weekday_morn_log, na.action = na.exclude)

Coefficients:
         ORIGIN_hex29           ORIGIN_hex31           ORIGIN_hex39  
            13.941726              14.686527              14.511614  
         ORIGIN_hex40           ORIGIN_hex41           ORIGIN_hex49  
            15.778904              12.548848              15.481746  
         ORIGIN_hex50           ORIGIN_hex51           ORIGIN_hex52  
            14.448042              12.540246              15.580428  
         ORIGIN_hex59           ORIGIN_hex60           ORIGIN_hex61  
            16.418298              14.914117              15.570167  
         ORIGIN_hex62           ORIGIN_hex63           ORIGIN_hex72  
            14.939332              11.699034              13.298299  
         ORIGIN_hex73           ORIGIN_hex74           ORIGIN_hex75  
            12.827047              13.880245              13.115962  
         ORIGIN_hex83           ORIGIN_hex84           ORIGIN_hex85  
            15.843727              14.930012              14.157577  
         ORIGIN_hex86           ORIGIN_hex87           ORIGIN_hex88  
            12.878800              13.235495              13.713483  
         ORIGIN_hex89           ORIGIN_hex96           ORIGIN_hex97  
            14.333183              15.705128              13.478527  
         ORIGIN_hex99          ORIGIN_hex100          ORIGIN_hex101  
            15.656556              17.069264              17.633010  
        ORIGIN_hex112          ORIGIN_hex113          ORIGIN_hex114  
            12.712998              14.335755               9.490448  
        ORIGIN_hex124          ORIGIN_hex125          ORIGIN_hex126  
            11.158036              14.405082              12.649131  
        ORIGIN_hex135          ORIGIN_hex136          ORIGIN_hex137  
            13.751430              17.726486              15.109572  
        ORIGIN_hex145          ORIGIN_hex146          ORIGIN_hex147  
            14.442351              13.414143              14.671502  
        ORIGIN_hex155          ORIGIN_hex156          ORIGIN_hex157  
            12.901492              13.555591              12.787999  
        ORIGIN_hex168          ORIGIN_hex169          ORIGIN_hex170  
            13.614060              16.045080              13.388980  
        ORIGIN_hex181          ORIGIN_hex182          ORIGIN_hex183  
            14.431850              13.136444              16.318944  
        ORIGIN_hex197          ORIGIN_hex198          ORIGIN_hex199  
            13.374041              12.843618              15.123314  
        ORIGIN_hex213          ORIGIN_hex214          ORIGIN_hex215  
            14.133948              13.792650              13.679009  
        ORIGIN_hex231          ORIGIN_hex232          ORIGIN_hex233  
            11.864972              12.649000              13.923933  
        ORIGIN_hex249          ORIGIN_hex250          ORIGIN_hex252  
            14.318927              12.590541              13.560720  
        ORIGIN_hex265          ORIGIN_hex266          ORIGIN_hex267  
            15.251744              14.302182              18.523794  
        ORIGIN_hex268          ORIGIN_hex269          ORIGIN_hex283  
            14.848553              15.230772              12.871893  
        ORIGIN_hex284          ORIGIN_hex286          ORIGIN_hex287  
            14.823941              14.882120              14.957886  
        ORIGIN_hex300          ORIGIN_hex301          ORIGIN_hex302  
            14.685108              14.045611              14.496621  
        ORIGIN_hex303          ORIGIN_hex304          ORIGIN_hex319  
            17.099615              15.809899              14.844829  
        ORIGIN_hex320          ORIGIN_hex321          ORIGIN_hex322  
            15.050513              16.869942              14.963639  
        ORIGIN_hex323          ORIGIN_hex334          ORIGIN_hex335  
            12.706506              13.272007              14.371458  
        ORIGIN_hex336          ORIGIN_hex337          ORIGIN_hex339  
            14.782400              17.557906              14.237878  
        ORIGIN_hex340          ORIGIN_hex351          ORIGIN_hex352  
            15.203247              16.391398              13.927078  
        ORIGIN_hex353          ORIGIN_hex354          ORIGIN_hex355  
            16.592074              17.671888              15.454003  
        ORIGIN_hex356          ORIGIN_hex357          ORIGIN_hex367  
            11.976002              12.362910              15.152006  
        ORIGIN_hex368          ORIGIN_hex369          ORIGIN_hex370  
            14.709301              14.026531              18.372584  
        ORIGIN_hex371          ORIGIN_hex373          ORIGIN_hex374  
            18.027871              12.676713              11.958584  
        ORIGIN_hex375          ORIGIN_hex376          ORIGIN_hex377  
            13.566971              11.934741              13.742155  
        ORIGIN_hex385          ORIGIN_hex386          ORIGIN_hex387  
            10.686091              12.905636              14.193445  
        ORIGIN_hex388          ORIGIN_hex390          ORIGIN_hex393  
            17.644868              12.684819              14.400442  
        ORIGIN_hex394          ORIGIN_hex395          ORIGIN_hex402  
            15.097358              12.594786              14.357819  
        ORIGIN_hex403          ORIGIN_hex404          ORIGIN_hex405  
            14.228550              18.904142              16.998255  
        ORIGIN_hex407          ORIGIN_hex411          ORIGIN_hex412  
            10.682999              11.468764              12.235389  
        ORIGIN_hex413          ORIGIN_hex419          ORIGIN_hex420  
            16.169922              13.705286              15.350403  
        ORIGIN_hex421          ORIGIN_hex422          ORIGIN_hex424  
            13.784245              17.730347              11.862284  
        ORIGIN_hex430          ORIGIN_hex437          ORIGIN_hex438  
            13.092312              13.679218              15.626560  
        ORIGIN_hex439          ORIGIN_hex440          ORIGIN_hex442  
            16.397451              16.746905              14.310808  
        ORIGIN_hex453          ORIGIN_hex454          ORIGIN_hex455  
            13.896835              12.315058              14.040773  
        ORIGIN_hex456          ORIGIN_hex471          ORIGIN_hex472  
            17.900772              15.489828              16.898744  
        ORIGIN_hex473          ORIGIN_hex474          ORIGIN_hex476  
            16.760433              17.906871              16.957158  
        ORIGIN_hex487          ORIGIN_hex488          ORIGIN_hex489  
            15.443727              13.906721              17.307152  
        ORIGIN_hex490          ORIGIN_hex504          ORIGIN_hex505  
            16.132467              15.997330              17.133876  
        ORIGIN_hex506          ORIGIN_hex508          ORIGIN_hex518  
            17.509539              13.131467              14.877898  
        ORIGIN_hex521          ORIGIN_hex522          ORIGIN_hex524  
            16.657164              12.577267              13.372622  
        ORIGIN_hex533          ORIGIN_hex534          ORIGIN_hex536  
            13.631265              16.066051              16.532694  
        ORIGIN_hex537          ORIGIN_hex539          ORIGIN_hex549  
            17.006909              16.997830              17.316585  
        ORIGIN_hex550          ORIGIN_hex551          ORIGIN_hex552  
            17.211997              17.527378              17.243546  
        ORIGIN_hex554          ORIGIN_hex555          ORIGIN_hex559  
            18.379012              12.273256              12.981431  
        ORIGIN_hex562          ORIGIN_hex564          ORIGIN_hex565  
            13.758394              14.712020              16.454318  
        ORIGIN_hex566          ORIGIN_hex567          ORIGIN_hex568  
            17.085712              16.411728              18.284361  
        ORIGIN_hex569          ORIGIN_hex577          ORIGIN_hex579  
            16.586100              11.873080              16.322517  
        ORIGIN_hex580          ORIGIN_hex581          ORIGIN_hex582  
            17.091905              17.337976              17.214483  
        ORIGIN_hex583          ORIGIN_hex584          ORIGIN_hex585  
            16.227926              17.108052              17.942843  
        ORIGIN_hex586          ORIGIN_hex588          ORIGIN_hex589  
            16.458943              13.222997              14.602615  
        ORIGIN_hex593          ORIGIN_hex594          ORIGIN_hex595  
            13.996657              16.143341              15.492652  
        ORIGIN_hex596          ORIGIN_hex597          ORIGIN_hex598  
            17.705209              17.018654              17.850524  
        ORIGIN_hex599          ORIGIN_hex600          ORIGIN_hex601  
            17.493733              17.978466              17.434516  
        ORIGIN_hex603          ORIGIN_hex604          ORIGIN_hex609  
            13.538053              15.070148              14.075396  
        ORIGIN_hex610          ORIGIN_hex611          ORIGIN_hex612  
            14.375296              16.078312              14.962767  
        ORIGIN_hex613          ORIGIN_hex614          ORIGIN_hex615  
            16.483729              17.047782              16.759729  
        ORIGIN_hex616          ORIGIN_hex617          ORIGIN_hex618  
            17.726710              16.541255              18.493332  
        ORIGIN_hex619          ORIGIN_hex620          ORIGIN_hex625  
            14.119358              12.987757              13.520039  
        ORIGIN_hex626          ORIGIN_hex627          ORIGIN_hex628  
            15.440559              14.767378              16.005124  
        ORIGIN_hex629          ORIGIN_hex630          ORIGIN_hex631  
            18.196375              17.020451              16.004897  
        ORIGIN_hex632          ORIGIN_hex633          ORIGIN_hex634  
            16.176995              15.217277              15.002547  
        ORIGIN_hex635          ORIGIN_hex636          ORIGIN_hex643  
            13.438600              14.515111              16.469511  
        ORIGIN_hex644          ORIGIN_hex645          ORIGIN_hex646  
            16.461607              15.105560              17.751026  
        ORIGIN_hex649          ORIGIN_hex650          ORIGIN_hex651  
            16.889481              14.802467              16.281555  
        ORIGIN_hex652          ORIGIN_hex653          ORIGIN_hex654  
            14.087886              12.105089              12.745382  
        ORIGIN_hex659          ORIGIN_hex660          ORIGIN_hex661  
            16.314851              16.810256              15.060689  
        ORIGIN_hex662          ORIGIN_hex663          ORIGIN_hex665  
            16.094337              16.547124              15.315637  
        ORIGIN_hex666          ORIGIN_hex668          ORIGIN_hex669  
            17.295610              14.159800              16.718666  
        ORIGIN_hex670          ORIGIN_hex676          ORIGIN_hex677  
            15.898829              16.887221              16.928924  
        ORIGIN_hex678          ORIGIN_hex680          ORIGIN_hex681  
            17.290542              14.728050              17.129593  
        ORIGIN_hex682          ORIGIN_hex683          ORIGIN_hex687  
            15.744141              18.133636              18.494135  
        ORIGIN_hex688          ORIGIN_hex693          ORIGIN_hex694  
            15.390381              15.944302              17.741531  
        ORIGIN_hex695          ORIGIN_hex696          ORIGIN_hex697  
            18.829296              15.471369              16.258686  
        ORIGIN_hex698          ORIGIN_hex699          ORIGIN_hex700  
            14.840163              16.779738              16.824952  
        ORIGIN_hex701          ORIGIN_hex703          ORIGIN_hex706  
            17.904865              12.879872              19.579615  
        ORIGIN_hex711          ORIGIN_hex712          ORIGIN_hex713  
            15.085365              17.288895              16.110780  
        ORIGIN_hex715          ORIGIN_hex716          ORIGIN_hex718  
            16.791325              16.035828              17.205091  
        ORIGIN_hex722          ORIGIN_hex723          ORIGIN_hex729  
            16.422833              16.915723              15.749121  
        ORIGIN_hex730          ORIGIN_hex731          ORIGIN_hex732  
            11.246370              16.433882              15.708651  
        ORIGIN_hex733          ORIGIN_hex735          ORIGIN_hex736  
            17.056827              14.742062              18.322596  
        ORIGIN_hex737          ORIGIN_hex739          ORIGIN_hex741  
            17.500627              15.314887              18.058900  
        ORIGIN_hex742          ORIGIN_hex746          ORIGIN_hex747  
            17.639043              15.949597              14.222913  
        ORIGIN_hex748          ORIGIN_hex749          ORIGIN_hex750  
            17.243831              16.292277              15.314301  
        ORIGIN_hex751          ORIGIN_hex753          ORIGIN_hex754  
            16.011234              16.916974              15.869324  
        ORIGIN_hex758          ORIGIN_hex759          ORIGIN_hex760  
            16.185841              17.590699              13.796223  
        ORIGIN_hex764          ORIGIN_hex766          ORIGIN_hex767  
            17.558951              16.757200              15.802759  
        ORIGIN_hex769          ORIGIN_hex775          ORIGIN_hex777  
            16.134404              15.558900              17.145237  
        ORIGIN_hex778          ORIGIN_hex782          ORIGIN_hex783  
            17.457578              13.933052              16.234259  
        ORIGIN_hex784          ORIGIN_hex785          ORIGIN_hex786  
            17.206332              14.845523              18.094206  
        ORIGIN_hex794          ORIGIN_hex795          ORIGIN_hex796  
            14.694122              18.853688              18.207146  
        ORIGIN_hex799          ORIGIN_hex800          ORIGIN_hex801  
            16.082331              16.151337              14.860399  
        ORIGIN_hex802          ORIGIN_hex810          ORIGIN_hex812  
            15.348788              12.570259              17.661687  
        ORIGIN_hex813          ORIGIN_hex816          ORIGIN_hex817  
            16.923569              16.441912              15.711776  
        ORIGIN_hex818          ORIGIN_hex819          ORIGIN_hex820  
            14.263621              17.569668              14.997069  
        ORIGIN_hex821          ORIGIN_hex827          ORIGIN_hex829  
            15.841442              14.670104              15.720891  
        ORIGIN_hex830          ORIGIN_hex831          ORIGIN_hex835  
            17.667153              16.898253              15.088688  
        ORIGIN_hex836          ORIGIN_hex837          ORIGIN_hex838  
            16.142949              15.487210              15.747397  
        ORIGIN_hex847          ORIGIN_hex848          ORIGIN_hex849  
            17.735052              17.663137              15.130504  
        ORIGIN_hex851          ORIGIN_hex853          ORIGIN_hex854  
            15.361874              15.640549              15.580845  
        ORIGIN_hex856          ORIGIN_hex863          ORIGIN_hex864  
            16.526579              14.885474              15.370808  
        ORIGIN_hex865          ORIGIN_hex866          ORIGIN_hex867  
            18.493684              17.028145               8.989600  
        ORIGIN_hex868          ORIGIN_hex869          ORIGIN_hex870  
            14.269283              15.386265              16.608807  
        ORIGIN_hex871          ORIGIN_hex873          ORIGIN_hex882  
            17.590288              15.126386              18.014057  
        ORIGIN_hex883          ORIGIN_hex884          ORIGIN_hex885  
            17.725318              16.106893              12.387087  
        ORIGIN_hex887          ORIGIN_hex888          ORIGIN_hex889  
            15.871955              16.633082              15.969107  
        ORIGIN_hex890          ORIGIN_hex899          ORIGIN_hex901  
            15.906660              14.505301              17.346807  
        ORIGIN_hex902          ORIGIN_hex903          ORIGIN_hex905  
            17.112726              14.939543              17.017832  
        ORIGIN_hex906          ORIGIN_hex907          ORIGIN_hex909  
            16.329331              16.982982              16.597466  
        ORIGIN_hex910          ORIGIN_hex917          ORIGIN_hex920  
            15.983674              12.577237              17.731915  
        ORIGIN_hex922          ORIGIN_hex925          ORIGIN_hex926  
            14.252100              16.857232              16.566994  
        ORIGIN_hex927          ORIGIN_hex928          ORIGIN_hex929  
            16.302026              14.069325              15.766700  
        ORIGIN_hex936          ORIGIN_hex937          ORIGIN_hex940  
            14.942155              13.734781              16.754238  
        ORIGIN_hex941          ORIGIN_hex944          ORIGIN_hex945  
            15.962533              15.796854              16.576152  
        ORIGIN_hex946          ORIGIN_hex947          ORIGIN_hex949  
            16.268667              14.389526              15.294318  
        ORIGIN_hex955          ORIGIN_hex959          ORIGIN_hex960  
            13.321699              17.035019              17.439962  
        ORIGIN_hex962          ORIGIN_hex963          ORIGIN_hex964  
            14.217816              16.502438              16.799492  
        ORIGIN_hex965          ORIGIN_hex966          ORIGIN_hex968  
            17.610421              14.782014              16.303432  
        ORIGIN_hex969          ORIGIN_hex974          ORIGIN_hex975  
            12.981431              11.998804              16.190043  
        ORIGIN_hex978          ORIGIN_hex979          ORIGIN_hex980  
            15.040986              18.468961              16.290940  
        ORIGIN_hex983          ORIGIN_hex984          ORIGIN_hex985  
            17.399461              15.938544              15.296994  
        ORIGIN_hex986          ORIGIN_hex989          ORIGIN_hex993  
            15.823569              13.511580              12.576805  
        ORIGIN_hex994          ORIGIN_hex995          ORIGIN_hex996  
            17.525395              13.642925              12.447830  
        ORIGIN_hex998          ORIGIN_hex999         ORIGIN_hex1002  
            17.337974              16.835998              11.170660  
       ORIGIN_hex1004         ORIGIN_hex1005         ORIGIN_hex1006  
            17.257431              17.775195              14.798336  
       ORIGIN_hex1008         ORIGIN_hex1013         ORIGIN_hex1015  
            16.987636              15.591885              15.785615  
       ORIGIN_hex1016         ORIGIN_hex1017         ORIGIN_hex1018  
            14.053078              16.468865              16.531290  
       ORIGIN_hex1019         ORIGIN_hex1023         ORIGIN_hex1024  
            16.835881              15.561017              17.173393  
       ORIGIN_hex1025         ORIGIN_hex1026         ORIGIN_hex1027  
            16.471941              15.656089              15.712516  
       ORIGIN_hex1028         ORIGIN_hex1029         ORIGIN_hex1031  
            13.510506              11.737981              15.589593  
       ORIGIN_hex1032         ORIGIN_hex1034         ORIGIN_hex1035  
            16.238516              13.638489              13.265115  
       ORIGIN_hex1036         ORIGIN_hex1037         ORIGIN_hex1038  
            15.968548              18.327185              16.897474  
       ORIGIN_hex1039         ORIGIN_hex1044         ORIGIN_hex1045  
            14.388199              16.265022              16.307244  
       ORIGIN_hex1046         ORIGIN_hex1047         ORIGIN_hex1048  
            15.526123              15.357702              14.947427  
       ORIGIN_hex1051         ORIGIN_hex1052         ORIGIN_hex1053  
            16.537455              15.903160              15.486591  
       ORIGIN_hex1056         ORIGIN_hex1057         ORIGIN_hex1058  
            18.316466              16.990604              16.660822  
       ORIGIN_hex1059         ORIGIN_hex1063         ORIGIN_hex1065  
            17.925714              12.629304              14.115007  
       ORIGIN_hex1067         ORIGIN_hex1068         ORIGIN_hex1069  
            16.279083              15.267579              16.071086  
       ORIGIN_hex1070         ORIGIN_hex1071         ORIGIN_hex1072  
            16.404002              16.414358              16.890049  
       ORIGIN_hex1073         ORIGIN_hex1075         ORIGIN_hex1076  
            14.866919              15.282488              17.246158  
       ORIGIN_hex1077         ORIGIN_hex1078         ORIGIN_hex1079  
            17.860944              17.261760              16.045694  
       ORIGIN_hex1083         ORIGIN_hex1085         ORIGIN_hex1086  
            16.489408              15.455811              16.682858  
       ORIGIN_hex1088         ORIGIN_hex1089         ORIGIN_hex1090  
            15.200457              14.574898              16.175910  
       ORIGIN_hex1091         ORIGIN_hex1092         ORIGIN_hex1093  
            17.238538              17.511649              16.024937  
       ORIGIN_hex1095         ORIGIN_hex1096         ORIGIN_hex1097  
            18.051446              18.422598              17.190644  
       ORIGIN_hex1099         ORIGIN_hex1103         ORIGIN_hex1104  
            16.705139              14.469390              15.131660  
       ORIGIN_hex1106         ORIGIN_hex1107         ORIGIN_hex1108  
            16.332404              17.372863              16.618729  
       ORIGIN_hex1109         ORIGIN_hex1110         ORIGIN_hex1111  
            16.203701              16.634239              16.824714  
       ORIGIN_hex1112         ORIGIN_hex1115         ORIGIN_hex1116  
            16.590934              17.732854              18.821337  
       ORIGIN_hex1124         ORIGIN_hex1125         ORIGIN_hex1126  
            15.540055              16.520968              17.763893  
       ORIGIN_hex1127         ORIGIN_hex1128         ORIGIN_hex1129  
            15.016002              17.937846              17.547068  
       ORIGIN_hex1130         ORIGIN_hex1131         ORIGIN_hex1133  
            18.173383              14.674195              18.063239  
       ORIGIN_hex1134         ORIGIN_hex1142         ORIGIN_hex1143  
            18.325317              17.124013              16.151998  
       ORIGIN_hex1144         ORIGIN_hex1145         ORIGIN_hex1146  
            16.140934              16.932807              17.306902  
       ORIGIN_hex1147         ORIGIN_hex1148         ORIGIN_hex1149  
            16.943247              16.366466              14.153610  
       ORIGIN_hex1152         ORIGIN_hex1153         ORIGIN_hex1161  
            17.251356              17.515032              14.206411  
       ORIGIN_hex1162         ORIGIN_hex1163         ORIGIN_hex1164  
            16.985970              17.045217              17.021968  
       ORIGIN_hex1165         ORIGIN_hex1166         ORIGIN_hex1168  
            15.956534              18.039248              15.606248  
       ORIGIN_hex1171         ORIGIN_hex1178         ORIGIN_hex1179  
            18.000270              16.113331              16.410992  
       ORIGIN_hex1180         ORIGIN_hex1181         ORIGIN_hex1182  
            17.106675              16.758149              17.443294  
       ORIGIN_hex1183         ORIGIN_hex1187         ORIGIN_hex1194  
            17.388785              16.313968              14.005661  
       ORIGIN_hex1196         ORIGIN_hex1197         ORIGIN_hex1198  
            16.168565              18.444903              16.326346  
       ORIGIN_hex1199         ORIGIN_hex1200         ORIGIN_hex1202  
            14.308318              17.633565              16.255573  
       ORIGIN_hex1203         ORIGIN_hex1205         ORIGIN_hex1212  
            14.665980              15.769942              15.894448  
       ORIGIN_hex1213         ORIGIN_hex1214         ORIGIN_hex1215  
            17.140770              16.639706              15.651148  
       ORIGIN_hex1216         ORIGIN_hex1217         ORIGIN_hex1218  
            15.182060              15.083403              14.645178  
       ORIGIN_hex1220         ORIGIN_hex1221         ORIGIN_hex1226  
            12.190644              13.603521              15.321408  
       ORIGIN_hex1227         ORIGIN_hex1228         ORIGIN_hex1229  
            14.808829              17.737910              17.374194  
       ORIGIN_hex1230         ORIGIN_hex1231         ORIGIN_hex1232  
            15.021460              15.807932              15.938570  
       ORIGIN_hex1233         ORIGIN_hex1234         ORIGIN_hex1235  
            15.554207              14.264822              13.310347  
       ORIGIN_hex1236         ORIGIN_hex1243         ORIGIN_hex1244  
            12.019698              14.230935              17.622531  
       ORIGIN_hex1245         ORIGIN_hex1246         ORIGIN_hex1247  
            17.019429              16.791324              16.459718  
       ORIGIN_hex1248         ORIGIN_hex1249         ORIGIN_hex1251  
            14.874189              16.217108              13.660673  
       ORIGIN_hex1252         ORIGIN_hex1257         ORIGIN_hex1258  
            13.387452              16.705565              16.995316  
       ORIGIN_hex1259         ORIGIN_hex1260         ORIGIN_hex1261  
            16.346664              16.643829              15.831271  
       ORIGIN_hex1262         ORIGIN_hex1263         ORIGIN_hex1264  
            17.024770              17.312161              15.659703  
       ORIGIN_hex1265         ORIGIN_hex1266         ORIGIN_hex1267  
            17.436759              17.443253              15.152703  
       ORIGIN_hex1272         ORIGIN_hex1273         ORIGIN_hex1274  
            14.680517              15.989261              15.216407  
       ORIGIN_hex1275         ORIGIN_hex1276         ORIGIN_hex1277  
            15.702071              17.645803              16.498808  
       ORIGIN_hex1278         ORIGIN_hex1279         ORIGIN_hex1280  
            17.819289              16.530316              16.797529  
       ORIGIN_hex1281         ORIGIN_hex1285         ORIGIN_hex1286  
            12.843386              11.792834              16.577600  
       ORIGIN_hex1287         ORIGIN_hex1288         ORIGIN_hex1289  
            15.608486              16.730238              15.824725  
       ORIGIN_hex1290         ORIGIN_hex1291         ORIGIN_hex1292  
            15.828193              17.092593              17.237887  
       ORIGIN_hex1293         ORIGIN_hex1299         ORIGIN_hex1300  
            17.187038              16.272499              17.272346  
       ORIGIN_hex1301         ORIGIN_hex1302         ORIGIN_hex1303  
            16.023360              14.518261              16.467258  
       ORIGIN_hex1305         ORIGIN_hex1306         ORIGIN_hex1307  
            17.907382              17.816466              17.410182  
       ORIGIN_hex1312         ORIGIN_hex1313         ORIGIN_hex1314  
            16.298185              17.125249              15.896842  
       ORIGIN_hex1315         ORIGIN_hex1316         ORIGIN_hex1317  
            16.438264              14.549282              16.716732  
       ORIGIN_hex1318         ORIGIN_hex1319         ORIGIN_hex1320  
            17.026531              17.174566              17.677045  
       ORIGIN_hex1326         ORIGIN_hex1327         ORIGIN_hex1328  
            15.960319              16.789044              15.466883  
       ORIGIN_hex1329         ORIGIN_hex1330         ORIGIN_hex1331  
            17.280776              17.670690              17.275482  
       ORIGIN_hex1332         ORIGIN_hex1333         ORIGIN_hex1336  
            16.416664              17.170094              15.474541  
       ORIGIN_hex1337         ORIGIN_hex1338         ORIGIN_hex1339  
            16.378142              16.865610              15.104971  
       ORIGIN_hex1340         ORIGIN_hex1341         ORIGIN_hex1342  
            13.457586              16.646999              17.737851  
       ORIGIN_hex1343         ORIGIN_hex1344         ORIGIN_hex1345  
            16.989639              17.500813              18.077687  
       ORIGIN_hex1348         ORIGIN_hex1349         ORIGIN_hex1350  
            16.032886              16.507581              14.926218  
       ORIGIN_hex1351         ORIGIN_hex1352         ORIGIN_hex1353  
            14.689424              13.201876              17.409218  
       ORIGIN_hex1354         ORIGIN_hex1355         ORIGIN_hex1356  
            17.214238              17.631644              16.856051  
       ORIGIN_hex1357         ORIGIN_hex1359         ORIGIN_hex1360  
            17.009585              14.546477              16.645838  
       ORIGIN_hex1362         ORIGIN_hex1363         ORIGIN_hex1365  
            16.256283              14.137071              17.266998  
       ORIGIN_hex1366         ORIGIN_hex1367         ORIGIN_hex1368  
            16.875438              17.720569              18.070349  
       ORIGIN_hex1369         ORIGIN_hex1370         ORIGIN_hex1371  
            15.750391              16.507398              16.862575  
       ORIGIN_hex1372         ORIGIN_hex1373         ORIGIN_hex1374  
            17.475842              14.681814              15.317118  
       ORIGIN_hex1375         ORIGIN_hex1376         ORIGIN_hex1377  
            14.173151              17.198511              17.539748  
       ORIGIN_hex1378         ORIGIN_hex1379         ORIGIN_hex1382  
            17.992754              15.965411              16.112638  
       ORIGIN_hex1383         ORIGIN_hex1384         ORIGIN_hex1388  
            17.360037              16.447788              16.743708  
       ORIGIN_hex1389         ORIGIN_hex1390         ORIGIN_hex1391  
            18.617362              17.829950              16.962478  
       ORIGIN_hex1392         ORIGIN_hex1393         ORIGIN_hex1394  
            16.936814              16.444998              15.652475  
       ORIGIN_hex1395         ORIGIN_hex1397         ORIGIN_hex1399  
            14.115114              15.205715              17.034757  
       ORIGIN_hex1400         ORIGIN_hex1401         ORIGIN_hex1402  
            17.105069              14.646578              15.444933  
       ORIGIN_hex1404         ORIGIN_hex1405         ORIGIN_hex1406  
            16.227093              16.895880              17.652443  
       ORIGIN_hex1409         ORIGIN_hex1410         ORIGIN_hex1411  
            15.636668              11.433354              16.828489  
       ORIGIN_hex1412         ORIGIN_hex1413         ORIGIN_hex1414  
            17.122658              12.639092              16.673068  
       ORIGIN_hex1415         ORIGIN_hex1416         ORIGIN_hex1417  
            14.506310              16.400640              16.164204  
       ORIGIN_hex1420         ORIGIN_hex1422         ORIGIN_hex1426  
            11.291291              17.080428              16.122460  
       ORIGIN_hex1427         ORIGIN_hex1428         ORIGIN_hex1429  
            15.582142              16.538496              15.043929  
       ORIGIN_hex1432         ORIGIN_hex1433         ORIGIN_hex1434  
            12.998846              15.902035              17.530742  
       ORIGIN_hex1437         ORIGIN_hex1438         ORIGIN_hex1439  
            15.801557              17.502380              17.352608  
       ORIGIN_hex1442         ORIGIN_hex1444         ORIGIN_hex1446  
            16.287854              17.215700              16.356398  
       ORIGIN_hex1447         ORIGIN_hex1448         ORIGIN_hex1450  
            17.343619              17.375499              12.080689  
       ORIGIN_hex1451         ORIGIN_hex1456         ORIGIN_hex1457  
            14.117698              15.507512              17.558390  
       ORIGIN_hex1458         ORIGIN_hex1459         ORIGIN_hex1460  
            16.542813              17.608407              15.953953  
       ORIGIN_hex1461         ORIGIN_hex1465         ORIGIN_hex1466  
            16.488393              16.163076              17.322503  
       ORIGIN_hex1467         ORIGIN_hex1468         ORIGIN_hex1469  
            17.431679              16.680450              17.831600  
       ORIGIN_hex1470         ORIGIN_hex1471         ORIGIN_hex1475  
            16.606411              17.249899              16.309334  
       ORIGIN_hex1476         ORIGIN_hex1477         ORIGIN_hex1478  
            17.123746              16.120480              17.391347  
       ORIGIN_hex1479         ORIGIN_hex1480         ORIGIN_hex1481  
            17.359886              17.405422              15.159810  
       ORIGIN_hex1484         ORIGIN_hex1485         ORIGIN_hex1486  
            16.992488              17.214747              17.004646  
       ORIGIN_hex1487         ORIGIN_hex1488         ORIGIN_hex1489  
            17.388341              17.088861              17.399317  
       ORIGIN_hex1491         ORIGIN_hex1492         ORIGIN_hex1493  
            16.370831              17.454187              13.870729  
       ORIGIN_hex1494         ORIGIN_hex1495         ORIGIN_hex1496  
            18.094034              17.132408              17.966495  
       ORIGIN_hex1497         ORIGIN_hex1499         ORIGIN_hex1500  
            15.233620              17.240729              15.453620  
       ORIGIN_hex1501         ORIGIN_hex1502         ORIGIN_hex1503  
            16.077557              17.482216              15.834722  
       ORIGIN_hex1504         ORIGIN_hex1506         ORIGIN_hex1507  
            16.481122              16.046127              17.800950  
       ORIGIN_hex1508         ORIGIN_hex1509         ORIGIN_hex1510  
            16.698743              16.864839              16.553998  
       ORIGIN_hex1511         ORIGIN_hex1513         ORIGIN_hex1514  
            17.876134              14.019724              16.600677  
       ORIGIN_hex1515         ORIGIN_hex1516         ORIGIN_hex1517  
            15.336025              16.952507              17.437992  
       ORIGIN_hex1518         ORIGIN_hex1522         ORIGIN_hex1523  
            17.529659              15.642628              17.169452  
       ORIGIN_hex1524         ORIGIN_hex1525         ORIGIN_hex1528  
            17.093399              17.505508              16.436929  
       ORIGIN_hex1529         ORIGIN_hex1530         ORIGIN_hex1531  
            16.634541              17.518844              17.467879  
       ORIGIN_hex1532         ORIGIN_hex1534         ORIGIN_hex1535  
            17.675980              13.412019              16.040201  
       ORIGIN_hex1536         ORIGIN_hex1537         ORIGIN_hex1538  
            16.293275              17.041024              17.285379  
       ORIGIN_hex1540         ORIGIN_hex1541         ORIGIN_hex1542  
            13.999549              16.403323              17.484509  
       ORIGIN_hex1543         ORIGIN_hex1544         ORIGIN_hex1546  
            16.445268              17.040666              13.604972  
       ORIGIN_hex1547         ORIGIN_hex1548         ORIGIN_hex1549  
            12.548487              14.620608              15.333143  
       ORIGIN_hex1550         ORIGIN_hex1551         ORIGIN_hex1553  
            16.322607              13.821933              14.513254  
       ORIGIN_hex1554         ORIGIN_hex1555         ORIGIN_hex1556  
            15.959938              14.946524              15.219641  
       ORIGIN_hex1557         ORIGIN_hex1563         ORIGIN_hex1564  
            13.536711              15.066083              15.121793  
       ORIGIN_hex1565         ORIGIN_hex1570         ORIGIN_hex1571  
            14.600555              15.815852              13.526481  
       ORIGIN_hex1572         ORIGIN_hex1575         ORIGIN_hex1579  
            14.400076              17.271088              15.722251  
       ORIGIN_hex1583         ORIGIN_hex1584         ORIGIN_hex1587  
            15.684437              17.492428              16.070496  
       ORIGIN_hex1588         ORIGIN_hex1592         ORIGIN_hex1594  
            16.907067              16.901499              16.394029  
       ORIGIN_hex1602         ORIGIN_hex1603         ORIGIN_hex1608  
            12.497485              15.908894              16.867101  
       ORIGIN_hex1609         ORIGIN_hex1616         ORIGIN_hex1623  
            16.939043              15.914756              15.966861  
       ORIGIN_hex1630         ORIGIN_hex1643         ORIGIN_hex1644  
            11.262349              15.911123              17.598697  
       ORIGIN_hex1665            d_biz_count         d_school_count  
            15.216507               0.134182              -0.223142  
          d_fin_count             d_hc_count        d_busstop_count  
             0.429166               0.007091               0.250849  
      d_housing_count  d_leisure_recre_count         d_retail_count  
            -0.043324              -0.015484               0.093737  
      d_entertn_count       d_food_bev_count                   dist  
             0.211118              -0.272079              -1.561917  

Degrees of Freedom: 51926 Total (i.e. Null);  51119 Residual
Null Deviance:      2.38e+08 
Residual Deviance: 30360000     AIC: 30640000

4.8 Destination Constraint Spatial Interaction Model

Next, we will fit a destination constrained Spatial Interaction Model (SIM). For destination constrained SIM, only explanatory variables which represent how propulsive the origins are will be used. This is because such models emphasize the demand or attractiveness of the destinations rather than the limitations or capacities of the origins. The demand or attractiveness of the destination sites determines the potential for generating interactions or flows.

desSIM_weekday_morn <- glm(TOTAL_TRIPS ~ DESTIN_hex + o_biz_count + o_school_count + o_fin_count + o_hc_count + o_busstop_count + o_housing_count + o_leisure_recre_count + o_retail_count + o_entertn_count + o_food_bev_count + dist - 1,
              family = poisson(link = "log"),
              data = flow_data_weekday_morn_log,
              na.action = na.exclude)
desSIM_weekday_morn

Call:  glm(formula = TOTAL_TRIPS ~ DESTIN_hex + o_biz_count + o_school_count + 
    o_fin_count + o_hc_count + o_busstop_count + o_housing_count + 
    o_leisure_recre_count + o_retail_count + o_entertn_count + 
    o_food_bev_count + dist - 1, family = poisson(link = "log"), 
    data = flow_data_weekday_morn_log, na.action = na.exclude)

Coefficients:
         DESTIN_hex29           DESTIN_hex31           DESTIN_hex39  
             16.29641               16.92718               18.31263  
         DESTIN_hex40           DESTIN_hex41           DESTIN_hex49  
             18.14769               15.95552               14.98285  
         DESTIN_hex50           DESTIN_hex51           DESTIN_hex52  
             18.01659               17.28346               17.60414  
         DESTIN_hex59           DESTIN_hex60           DESTIN_hex61  
             16.38878               15.07300               16.40978  
         DESTIN_hex62           DESTIN_hex63           DESTIN_hex72  
             16.90342               15.57061               15.45554  
         DESTIN_hex73           DESTIN_hex74           DESTIN_hex75  
             17.76024               16.69284               16.14773  
         DESTIN_hex83           DESTIN_hex84           DESTIN_hex85  
             16.66879               16.57992               15.71083  
         DESTIN_hex86           DESTIN_hex87           DESTIN_hex88  
             16.36325               17.48318               17.30290  
         DESTIN_hex89           DESTIN_hex96           DESTIN_hex97  
             17.40281               14.56358               16.02026  
         DESTIN_hex99          DESTIN_hex100          DESTIN_hex101  
             17.63771               16.19638               16.21299  
        DESTIN_hex112          DESTIN_hex113          DESTIN_hex114  
             17.47549               15.96331               13.80291  
        DESTIN_hex124          DESTIN_hex125          DESTIN_hex126  
             14.95177               17.16265               15.54569  
        DESTIN_hex135          DESTIN_hex136          DESTIN_hex137  
             18.06108               16.07555               16.42547  
        DESTIN_hex145          DESTIN_hex146          DESTIN_hex147  
             15.32486               16.20131               17.24990  
        DESTIN_hex155          DESTIN_hex156          DESTIN_hex157  
             13.96431               15.99718               15.74272  
        DESTIN_hex168          DESTIN_hex169          DESTIN_hex170  
             17.10045               16.67306               16.43496  
        DESTIN_hex181          DESTIN_hex182          DESTIN_hex183  
             17.03828               16.21434               14.57910  
        DESTIN_hex197          DESTIN_hex198          DESTIN_hex199  
             16.87873               17.25488               18.09667  
        DESTIN_hex213          DESTIN_hex214          DESTIN_hex215  
             16.41227               17.18189               17.86791  
        DESTIN_hex231          DESTIN_hex232          DESTIN_hex233  
             14.49765               15.87206               18.75080  
        DESTIN_hex249          DESTIN_hex250          DESTIN_hex252  
             16.48458               17.25271               17.29257  
        DESTIN_hex265          DESTIN_hex266          DESTIN_hex267  
             17.25747               17.62888               16.95999  
        DESTIN_hex268          DESTIN_hex269          DESTIN_hex283  
             16.87531               17.92285               15.32062  
        DESTIN_hex284          DESTIN_hex286          DESTIN_hex287  
             17.50197               11.85000               16.19406  
        DESTIN_hex288          DESTIN_hex300          DESTIN_hex301  
             10.42242               16.44809               17.87703  
        DESTIN_hex302          DESTIN_hex303          DESTIN_hex304  
             16.92462               16.59241               16.03264  
        DESTIN_hex319          DESTIN_hex320          DESTIN_hex321  
             16.48005               16.06172               15.00611  
        DESTIN_hex322          DESTIN_hex323          DESTIN_hex334  
             18.51881               10.94554               15.09693  
        DESTIN_hex335          DESTIN_hex336          DESTIN_hex337  
             17.94818               16.17114               16.67617  
        DESTIN_hex339          DESTIN_hex340          DESTIN_hex351  
             15.50465               16.00509               17.40285  
        DESTIN_hex352          DESTIN_hex353          DESTIN_hex354  
             16.60806               16.56099               16.89379  
        DESTIN_hex355          DESTIN_hex356          DESTIN_hex357  
             15.07799               13.60477               13.40582  
        DESTIN_hex367          DESTIN_hex368          DESTIN_hex369  
             16.40754               16.14068               15.19648  
        DESTIN_hex370          DESTIN_hex371          DESTIN_hex373  
             17.44499               16.47690               14.33728  
        DESTIN_hex374          DESTIN_hex375          DESTIN_hex377  
             15.20796               15.70589               13.76290  
        DESTIN_hex385          DESTIN_hex386          DESTIN_hex387  
             17.91030               17.87884               17.99494  
        DESTIN_hex388          DESTIN_hex390          DESTIN_hex393  
             16.01277               14.83431               14.01670  
        DESTIN_hex394          DESTIN_hex395          DESTIN_hex402  
             15.85652               15.78621               17.02728  
        DESTIN_hex403          DESTIN_hex404          DESTIN_hex405  
             16.44295               18.16550               16.12394  
        DESTIN_hex407          DESTIN_hex411          DESTIN_hex412  
             13.39033               13.65494               14.69220  
        DESTIN_hex413          DESTIN_hex419          DESTIN_hex420  
             15.10991               15.34646               16.68797  
        DESTIN_hex421          DESTIN_hex422          DESTIN_hex424  
             16.93458               16.40840               11.62166  
        DESTIN_hex430          DESTIN_hex437          DESTIN_hex438  
             12.80808               15.14744               16.04508  
        DESTIN_hex439          DESTIN_hex440          DESTIN_hex442  
             15.72230               15.31732               16.12263  
        DESTIN_hex453          DESTIN_hex454          DESTIN_hex455  
             16.49762               14.00112               15.80098  
        DESTIN_hex456          DESTIN_hex471          DESTIN_hex472  
             17.93885               16.54571               16.84128  
        DESTIN_hex473          DESTIN_hex474          DESTIN_hex476  
             15.94792               17.06285               16.38364  
        DESTIN_hex487          DESTIN_hex488          DESTIN_hex489  
             17.25917               15.00148               16.83524  
        DESTIN_hex490          DESTIN_hex504          DESTIN_hex505  
             14.59170               15.39796               14.00833  
        DESTIN_hex506          DESTIN_hex508          DESTIN_hex518  
             16.56109               15.91734               16.01372  
        DESTIN_hex521          DESTIN_hex522          DESTIN_hex524  
             16.39886               14.07722               13.88928  
        DESTIN_hex533          DESTIN_hex534          DESTIN_hex536  
             17.31610               17.02287               16.33386  
        DESTIN_hex537          DESTIN_hex539          DESTIN_hex549  
             15.90306               14.82157               15.90941  
        DESTIN_hex550          DESTIN_hex551          DESTIN_hex552  
             16.49194               16.58595               16.39809  
        DESTIN_hex554          DESTIN_hex555          DESTIN_hex559  
             16.11706               13.44166               15.74426  
        DESTIN_hex562          DESTIN_hex564          DESTIN_hex565  
             16.17834               15.16197               15.52028  
        DESTIN_hex566          DESTIN_hex567          DESTIN_hex568  
             16.15829               14.87059               15.87050  
        DESTIN_hex569          DESTIN_hex577          DESTIN_hex579  
             14.96313               15.92645               16.11964  
        DESTIN_hex580          DESTIN_hex581          DESTIN_hex582  
             17.73335               16.16215               15.53380  
        DESTIN_hex583          DESTIN_hex584          DESTIN_hex585  
             13.56601               16.23676               16.16663  
        DESTIN_hex586          DESTIN_hex588          DESTIN_hex589  
             15.08426               16.28597               17.43083  
        DESTIN_hex593          DESTIN_hex594          DESTIN_hex595  
             14.99029               15.73119               17.00372  
        DESTIN_hex596          DESTIN_hex597          DESTIN_hex598  
             15.66153               16.63142               15.78979  
        DESTIN_hex599          DESTIN_hex600          DESTIN_hex601  
             16.13289               17.85474               17.71287  
        DESTIN_hex603          DESTIN_hex604          DESTIN_hex609  
             15.49592               15.92531               16.30754  
        DESTIN_hex610          DESTIN_hex611          DESTIN_hex612  
             17.15631               15.31163               16.72062  
        DESTIN_hex613          DESTIN_hex614          DESTIN_hex615  
             15.76358               17.42514               15.89984  
        DESTIN_hex616          DESTIN_hex617          DESTIN_hex618  
             16.60105               14.91042               15.66958  
        DESTIN_hex619          DESTIN_hex620          DESTIN_hex625  
             17.18331               16.35699               15.90081  
        DESTIN_hex626          DESTIN_hex627          DESTIN_hex628  
             15.89966               17.38338               17.72436  
        DESTIN_hex629          DESTIN_hex630          DESTIN_hex631  
             17.10516               14.46864               16.22649  
        DESTIN_hex632          DESTIN_hex633          DESTIN_hex634  
             14.10692               14.61651               17.40261  
        DESTIN_hex635          DESTIN_hex636          DESTIN_hex643  
             13.69972               16.03074               16.88169  
        DESTIN_hex644          DESTIN_hex645          DESTIN_hex646  
             14.97006               17.05999               16.66125  
        DESTIN_hex649          DESTIN_hex650          DESTIN_hex651  
             15.95821               14.51967               17.48656  
        DESTIN_hex652          DESTIN_hex653          DESTIN_hex654  
             14.21041               16.20476               15.64389  
        DESTIN_hex659          DESTIN_hex660          DESTIN_hex661  
             16.55934               16.15706               16.61647  
        DESTIN_hex662          DESTIN_hex663          DESTIN_hex665  
             17.94784               15.82993               14.13371  
        DESTIN_hex666          DESTIN_hex668          DESTIN_hex669  
             15.87139               14.15045               16.09034  
        DESTIN_hex670          DESTIN_hex676          DESTIN_hex677  
             13.70738               16.13062               15.30605  
        DESTIN_hex678          DESTIN_hex680          DESTIN_hex681  
             16.00508               14.81002               16.29755  
        DESTIN_hex682          DESTIN_hex683          DESTIN_hex687  
             16.23482               17.97632               19.11726  
        DESTIN_hex688          DESTIN_hex693          DESTIN_hex694  
             16.76484               15.92313               16.78572  
        DESTIN_hex695          DESTIN_hex696          DESTIN_hex697  
             18.14810               16.15677               15.96672  
        DESTIN_hex698          DESTIN_hex699          DESTIN_hex700  
             14.75713               17.34129               14.74735  
        DESTIN_hex701          DESTIN_hex703          DESTIN_hex706  
             15.91709               16.00450               18.41535  
        DESTIN_hex711          DESTIN_hex712          DESTIN_hex713  
             17.17691               16.33640               15.74858  
        DESTIN_hex715          DESTIN_hex716          DESTIN_hex718  
             16.28766               14.51063               15.74221  
        DESTIN_hex722          DESTIN_hex723          DESTIN_hex729  
             15.24229               15.83301               16.39729  
        DESTIN_hex730          DESTIN_hex731          DESTIN_hex732  
             16.37457               14.95630               18.38733  
        DESTIN_hex733          DESTIN_hex735          DESTIN_hex736  
             17.72282               16.12168               16.94901  
        DESTIN_hex737          DESTIN_hex739          DESTIN_hex741  
             15.19692               15.82299               17.55703  
        DESTIN_hex742          DESTIN_hex746          DESTIN_hex747  
             16.64277               17.37722               16.95057  
        DESTIN_hex748          DESTIN_hex749          DESTIN_hex750  
             16.79783               15.05996               17.90711  
        DESTIN_hex751          DESTIN_hex753          DESTIN_hex754  
             15.94297               15.35211               12.79231  
        DESTIN_hex758          DESTIN_hex759          DESTIN_hex760  
             15.50789               16.26208               12.99378  
        DESTIN_hex764          DESTIN_hex766          DESTIN_hex767  
             17.26778               16.61536               14.72141  
        DESTIN_hex769          DESTIN_hex775          DESTIN_hex777  
             16.42438               16.88471               15.95020  
        DESTIN_hex778          DESTIN_hex782          DESTIN_hex783  
             17.40000               16.97862               16.86281  
        DESTIN_hex784          DESTIN_hex785          DESTIN_hex786  
             15.71715               14.03997               15.42869  
        DESTIN_hex794          DESTIN_hex795          DESTIN_hex796  
             13.12554               18.66140               17.00230  
        DESTIN_hex799          DESTIN_hex800          DESTIN_hex801  
             15.34349               16.95155               14.97225  
        DESTIN_hex802          DESTIN_hex810          DESTIN_hex812  
             15.18772               13.59443               16.65419  
        DESTIN_hex813          DESTIN_hex816          DESTIN_hex817  
             16.41613               16.11271               16.34578  
        DESTIN_hex818          DESTIN_hex819          DESTIN_hex820  
             16.53949               17.25407               14.09708  
        DESTIN_hex821          DESTIN_hex827          DESTIN_hex829  
             16.02286               17.17713               16.66256  
        DESTIN_hex830          DESTIN_hex831          DESTIN_hex835  
             15.75598               18.25914               16.54881  
        DESTIN_hex836          DESTIN_hex837          DESTIN_hex838  
             14.86879               14.96897               14.93903  
        DESTIN_hex847          DESTIN_hex848          DESTIN_hex849  
             15.70374               16.02890               17.64578  
        DESTIN_hex851          DESTIN_hex853          DESTIN_hex854  
             17.53841               15.98112               15.48962  
        DESTIN_hex856          DESTIN_hex863          DESTIN_hex864  
             16.29192               15.61683               14.38210  
        DESTIN_hex865          DESTIN_hex866          DESTIN_hex867  
             17.77067               17.27811               16.33260  
        DESTIN_hex868          DESTIN_hex869          DESTIN_hex870  
             15.44363               15.76305               15.59238  
        DESTIN_hex871          DESTIN_hex873          DESTIN_hex882  
             17.10580               15.95062               16.75090  
        DESTIN_hex883          DESTIN_hex884          DESTIN_hex885  
             16.05142               17.45023               15.42082  
        DESTIN_hex887          DESTIN_hex888          DESTIN_hex889  
             17.62944               16.72057               15.38100  
        DESTIN_hex890          DESTIN_hex899          DESTIN_hex901  
             15.06131               14.75402               16.47535  
        DESTIN_hex902          DESTIN_hex903          DESTIN_hex905  
             16.82661               17.14287               16.09321  
        DESTIN_hex906          DESTIN_hex907          DESTIN_hex909  
             15.80358               16.21766               16.20054  
        DESTIN_hex910          DESTIN_hex917          DESTIN_hex920  
             15.45505               11.58802               16.20011  
        DESTIN_hex922          DESTIN_hex925          DESTIN_hex926  
             17.56027               15.46908               17.02325  
        DESTIN_hex927          DESTIN_hex928          DESTIN_hex929  
             15.20056               15.08114               15.70970  
        DESTIN_hex936          DESTIN_hex937          DESTIN_hex940  
             14.69043               15.51881               17.89282  
        DESTIN_hex941          DESTIN_hex944          DESTIN_hex945  
             17.46466               15.67584               17.17368  
        DESTIN_hex946          DESTIN_hex947          DESTIN_hex949  
             16.44105               14.78962               15.64079  
        DESTIN_hex955          DESTIN_hex959          DESTIN_hex960  
             12.88820               16.51514               15.74441  
        DESTIN_hex962          DESTIN_hex963          DESTIN_hex964  
             15.11301               16.20886               16.14377  
        DESTIN_hex965          DESTIN_hex966          DESTIN_hex968  
             17.05712               15.48857               16.59771  
        DESTIN_hex969          DESTIN_hex974          DESTIN_hex975  
             14.43042               11.88350               16.31805  
        DESTIN_hex978          DESTIN_hex979          DESTIN_hex980  
             15.55900               17.72151               15.94269  
        DESTIN_hex982          DESTIN_hex983          DESTIN_hex984  
             14.36549               17.27748               17.50656  
        DESTIN_hex985          DESTIN_hex986          DESTIN_hex989  
             15.19641               16.34563               13.05545  
        DESTIN_hex993          DESTIN_hex994          DESTIN_hex995  
             16.02937               16.57536               14.32543  
        DESTIN_hex996          DESTIN_hex998          DESTIN_hex999  
             14.90239               15.75031               15.30624  
       DESTIN_hex1002         DESTIN_hex1004         DESTIN_hex1005  
             16.32575               15.46392               17.11310  
       DESTIN_hex1006         DESTIN_hex1008         DESTIN_hex1013  
             14.30454               17.48354               17.58215  
       DESTIN_hex1015         DESTIN_hex1016         DESTIN_hex1017  
             15.70443               14.60192               15.19016  
       DESTIN_hex1018         DESTIN_hex1019         DESTIN_hex1023  
             15.70165               14.99829               15.52574  
       DESTIN_hex1024         DESTIN_hex1025         DESTIN_hex1026  
             15.55176               15.79976               16.02717  
       DESTIN_hex1027         DESTIN_hex1028         DESTIN_hex1029  
             15.99254               14.55928               11.79943  
       DESTIN_hex1031         DESTIN_hex1032         DESTIN_hex1034  
             15.23884               15.79969               13.38729  
       DESTIN_hex1035         DESTIN_hex1036         DESTIN_hex1037  
             13.65753               13.79952               17.32804  
       DESTIN_hex1038         DESTIN_hex1039         DESTIN_hex1044  
             17.26623               14.59677               15.30480  
       DESTIN_hex1045         DESTIN_hex1046         DESTIN_hex1047  
             15.68987               15.50631               14.66666  
       DESTIN_hex1048         DESTIN_hex1051         DESTIN_hex1052  
             15.58845               16.38789               14.56731  
       DESTIN_hex1053         DESTIN_hex1056         DESTIN_hex1057  
             14.94105               18.25204               15.46625  
       DESTIN_hex1058         DESTIN_hex1059         DESTIN_hex1063  
             15.59751               16.08979               11.94224  
       DESTIN_hex1065         DESTIN_hex1067         DESTIN_hex1068  
             13.97198               16.79921               16.11692  
       DESTIN_hex1069         DESTIN_hex1070         DESTIN_hex1071  
             15.86251               16.28662               16.57756  
       DESTIN_hex1072         DESTIN_hex1073         DESTIN_hex1075  
             16.45791               15.50890               13.31486  
       DESTIN_hex1076         DESTIN_hex1077         DESTIN_hex1078  
             16.47403               16.45026               15.09669  
       DESTIN_hex1079         DESTIN_hex1083         DESTIN_hex1085  
             14.27037               16.16364               16.24419  
       DESTIN_hex1086         DESTIN_hex1088         DESTIN_hex1089  
             16.86594               16.34920               14.77913  
       DESTIN_hex1090         DESTIN_hex1091         DESTIN_hex1092  
             15.56674               16.54548               16.03890  
       DESTIN_hex1093         DESTIN_hex1095         DESTIN_hex1096  
             14.97487               16.74975               18.51822  
       DESTIN_hex1097         DESTIN_hex1099         DESTIN_hex1103  
             16.78929               15.62976               17.05497  
       DESTIN_hex1104         DESTIN_hex1106         DESTIN_hex1107  
             15.80158               16.38075               16.89758  
       DESTIN_hex1108         DESTIN_hex1109         DESTIN_hex1110  
             15.58815               15.84993               16.14068  
       DESTIN_hex1111         DESTIN_hex1112         DESTIN_hex1115  
             14.57433               15.81470               16.05808  
       DESTIN_hex1116         DESTIN_hex1124         DESTIN_hex1125  
             17.16894               16.58038               16.75230  
       DESTIN_hex1126         DESTIN_hex1127         DESTIN_hex1128  
             17.99302               15.12216               16.00799  
       DESTIN_hex1129         DESTIN_hex1130         DESTIN_hex1131  
             16.43584               16.95588               17.06439  
       DESTIN_hex1133         DESTIN_hex1134         DESTIN_hex1142  
             15.66198               16.31346               17.04235  
       DESTIN_hex1143         DESTIN_hex1144         DESTIN_hex1145  
             16.33132               16.04894               16.56583  
       DESTIN_hex1146         DESTIN_hex1147         DESTIN_hex1148  
             17.95070               15.33209               17.16456  
       DESTIN_hex1149         DESTIN_hex1152         DESTIN_hex1153  
             17.22080               15.53158               15.23291  
       DESTIN_hex1161         DESTIN_hex1162         DESTIN_hex1163  
             15.68438               16.44650               16.59687  
       DESTIN_hex1164         DESTIN_hex1165         DESTIN_hex1166  
             15.89317               15.39079               17.66286  
       DESTIN_hex1168         DESTIN_hex1171         DESTIN_hex1178  
             17.74807               16.10481               14.84058  
       DESTIN_hex1179         DESTIN_hex1180         DESTIN_hex1181  
             15.41889               15.94268               15.65323  
       DESTIN_hex1182         DESTIN_hex1183         DESTIN_hex1187  
             16.64364               17.19725               14.46070  
       DESTIN_hex1194         DESTIN_hex1196         DESTIN_hex1197  
             17.10145               15.20870               16.76871  
       DESTIN_hex1198         DESTIN_hex1199         DESTIN_hex1200  
             16.34679               14.85885               16.13751  
       DESTIN_hex1202         DESTIN_hex1203         DESTIN_hex1205  
             15.09981               15.61749               13.14147  
       DESTIN_hex1212         DESTIN_hex1213         DESTIN_hex1214  
             16.44243               15.91963               15.20517  
       DESTIN_hex1215         DESTIN_hex1216         DESTIN_hex1217  
             15.20102               14.79757               16.09384  
       DESTIN_hex1218         DESTIN_hex1220         DESTIN_hex1221  
             12.02286               13.47387               15.67443  
       DESTIN_hex1226         DESTIN_hex1227         DESTIN_hex1228  
             16.24826               15.03495               16.81403  
       DESTIN_hex1229         DESTIN_hex1230         DESTIN_hex1231  
             17.27326               14.51452               14.90120  
       DESTIN_hex1232         DESTIN_hex1233         DESTIN_hex1234  
             16.84640               17.01107               14.64603  
       DESTIN_hex1235         DESTIN_hex1236         DESTIN_hex1243  
             15.15918               13.82568               17.08061  
       DESTIN_hex1244         DESTIN_hex1245         DESTIN_hex1246  
             17.59165               16.34658               16.66235  
       DESTIN_hex1247         DESTIN_hex1248         DESTIN_hex1249  
             15.99462               16.30521               15.66722  
       DESTIN_hex1251         DESTIN_hex1252         DESTIN_hex1257  
             14.73730               14.44512               15.79583  
       DESTIN_hex1258         DESTIN_hex1259         DESTIN_hex1260  
             16.66376               16.58094               15.00128  
       DESTIN_hex1261         DESTIN_hex1262         DESTIN_hex1263  
             14.66524               15.74632               17.05141  
       DESTIN_hex1264         DESTIN_hex1265         DESTIN_hex1266  
             16.88180               15.79559               16.57847  
       DESTIN_hex1267         DESTIN_hex1272         DESTIN_hex1273  
             14.38521               15.81062               16.56383  
       DESTIN_hex1274         DESTIN_hex1275         DESTIN_hex1276  
             17.27810               14.31424               17.89279  
       DESTIN_hex1277         DESTIN_hex1278         DESTIN_hex1279  
             15.20153               17.00334               14.12549  
       DESTIN_hex1280         DESTIN_hex1281         DESTIN_hex1285  
             15.40898               14.28952               14.10558  
       DESTIN_hex1286         DESTIN_hex1287         DESTIN_hex1288  
             16.52225               16.01219               16.75140  
       DESTIN_hex1289         DESTIN_hex1290         DESTIN_hex1291  
             15.65424               15.32052               15.92627  
       DESTIN_hex1292         DESTIN_hex1293         DESTIN_hex1299  
             15.56009               15.60191               15.48524  
       DESTIN_hex1300         DESTIN_hex1301         DESTIN_hex1302  
             16.74544               16.86256               16.48860  
       DESTIN_hex1303         DESTIN_hex1305         DESTIN_hex1306  
             15.35543               16.52008               15.78356  
       DESTIN_hex1307         DESTIN_hex1312         DESTIN_hex1313  
             14.22095               16.14640               16.75410  
       DESTIN_hex1314         DESTIN_hex1315         DESTIN_hex1316  
             15.84239               16.53437               14.27942  
       DESTIN_hex1317         DESTIN_hex1318         DESTIN_hex1319  
             17.77337               15.29781               16.21879  
       DESTIN_hex1320         DESTIN_hex1326         DESTIN_hex1327  
             15.41495               15.24032               16.86571  
       DESTIN_hex1328         DESTIN_hex1329         DESTIN_hex1330  
             16.76643               16.74141               15.34557  
       DESTIN_hex1331         DESTIN_hex1332         DESTIN_hex1333  
             16.39562               14.65960               14.94066  
       DESTIN_hex1336         DESTIN_hex1337         DESTIN_hex1338  
             15.69548               15.71988               16.73143  
       DESTIN_hex1339         DESTIN_hex1340         DESTIN_hex1341  
             17.69232               15.39858               16.36274  
       DESTIN_hex1342         DESTIN_hex1343         DESTIN_hex1344  
             17.63913               17.21034               17.01577  
       DESTIN_hex1345         DESTIN_hex1348         DESTIN_hex1349  
             15.31524               15.96773               17.31238  
       DESTIN_hex1350         DESTIN_hex1351         DESTIN_hex1352  
             17.41589               16.30721               16.64085  
       DESTIN_hex1353         DESTIN_hex1354         DESTIN_hex1355  
             16.35558               15.64513               15.39467  
       DESTIN_hex1356         DESTIN_hex1357         DESTIN_hex1359  
             15.78402               14.86682               14.63079  
       DESTIN_hex1360         DESTIN_hex1362         DESTIN_hex1363  
             15.55259               17.40801               17.45032  
       DESTIN_hex1365         DESTIN_hex1366         DESTIN_hex1367  
             15.07951               15.19568               17.28028  
       DESTIN_hex1368         DESTIN_hex1369         DESTIN_hex1370  
             16.28239               14.27554               16.72367  
       DESTIN_hex1371         DESTIN_hex1372         DESTIN_hex1373  
             17.09392               17.04130               16.26204  
       DESTIN_hex1374         DESTIN_hex1375         DESTIN_hex1376  
             15.19424               13.96590               14.82529  
       DESTIN_hex1377         DESTIN_hex1378         DESTIN_hex1379  
             15.70340               15.92395               14.07656  
       DESTIN_hex1382         DESTIN_hex1383         DESTIN_hex1384  
             15.93269               16.91798               16.97811  
       DESTIN_hex1388         DESTIN_hex1389         DESTIN_hex1390  
             14.76255               17.15438               17.41365  
       DESTIN_hex1391         DESTIN_hex1392         DESTIN_hex1393  
             14.89898               17.35480               15.96185  
       DESTIN_hex1394         DESTIN_hex1395         DESTIN_hex1397  
             13.39193               14.66296               16.69654  
       DESTIN_hex1399         DESTIN_hex1400         DESTIN_hex1401  
             15.23187               15.24989               14.73293  
       DESTIN_hex1402         DESTIN_hex1404         DESTIN_hex1405  
             15.49332               15.03993               16.75270  
       DESTIN_hex1406         DESTIN_hex1409         DESTIN_hex1410  
             17.23378               17.20002               13.30387  
       DESTIN_hex1411         DESTIN_hex1412         DESTIN_hex1413  
             16.47340               15.44817               11.49031  
       DESTIN_hex1414         DESTIN_hex1415         DESTIN_hex1416  
             16.06104               14.08950               15.83026  
       DESTIN_hex1417         DESTIN_hex1420         DESTIN_hex1422  
             16.10552               13.12173               15.03269  
       DESTIN_hex1426         DESTIN_hex1427         DESTIN_hex1428  
             15.78987               16.66740               16.63393  
       DESTIN_hex1429         DESTIN_hex1432         DESTIN_hex1433  
             15.04646               15.76927               14.62921  
       DESTIN_hex1434         DESTIN_hex1437         DESTIN_hex1438  
             14.85470               16.15605               16.26119  
       DESTIN_hex1439         DESTIN_hex1442         DESTIN_hex1444  
             16.15452               16.73256               14.81276  
       DESTIN_hex1446         DESTIN_hex1447         DESTIN_hex1448  
             15.95868               17.24665               15.90376  
       DESTIN_hex1450         DESTIN_hex1451         DESTIN_hex1456  
             13.21318               14.57710               15.52288  
       DESTIN_hex1457         DESTIN_hex1458         DESTIN_hex1459  
             17.58072               14.47280               16.38068  
       DESTIN_hex1460         DESTIN_hex1461         DESTIN_hex1465  
             15.45427               17.48512               15.60079  
       DESTIN_hex1466         DESTIN_hex1467         DESTIN_hex1468  
             17.13795               16.78346               17.32593  
       DESTIN_hex1469         DESTIN_hex1470         DESTIN_hex1471  
             16.08859               16.34632               17.40516  
       DESTIN_hex1475         DESTIN_hex1476         DESTIN_hex1477  
             15.76939               16.17682               15.29621  
       DESTIN_hex1478         DESTIN_hex1479         DESTIN_hex1480  
             16.22616               15.89087               15.95430  
       DESTIN_hex1481         DESTIN_hex1484         DESTIN_hex1485  
             14.18592               15.63891               15.89463  
       DESTIN_hex1486         DESTIN_hex1487         DESTIN_hex1488  
             17.16933               15.66301               14.56335  
       DESTIN_hex1489         DESTIN_hex1491         DESTIN_hex1492  
             16.22799               15.09935               16.14070  
       DESTIN_hex1493         DESTIN_hex1494         DESTIN_hex1495  
             15.13821               18.24505               15.46343  
       DESTIN_hex1496         DESTIN_hex1497         DESTIN_hex1499  
             15.88831               15.14075               15.43285  
       DESTIN_hex1500         DESTIN_hex1501         DESTIN_hex1502  
             15.09123               15.53684               17.18306  
       DESTIN_hex1503         DESTIN_hex1504         DESTIN_hex1506  
             14.05674               16.39559               15.49875  
       DESTIN_hex1507         DESTIN_hex1508         DESTIN_hex1509  
             17.63195               17.20760               15.17774  
       DESTIN_hex1510         DESTIN_hex1511         DESTIN_hex1513  
             15.17863               18.30008               15.61082  
       DESTIN_hex1514         DESTIN_hex1515         DESTIN_hex1516  
             15.66820               17.50274               16.39025  
       DESTIN_hex1517         DESTIN_hex1518         DESTIN_hex1522  
             17.30607               15.26933               14.48982  
       DESTIN_hex1523         DESTIN_hex1524         DESTIN_hex1525  
             15.90264               15.41000               16.08385  
       DESTIN_hex1528         DESTIN_hex1529         DESTIN_hex1530  
             16.50118               15.37757               16.42357  
       DESTIN_hex1531         DESTIN_hex1532         DESTIN_hex1534  
             16.30016               15.54965               15.24733  
       DESTIN_hex1535         DESTIN_hex1536         DESTIN_hex1537  
             16.96461               16.00129               15.66600  
       DESTIN_hex1538         DESTIN_hex1540         DESTIN_hex1541  
             15.73754               17.42169               15.70294  
       DESTIN_hex1542         DESTIN_hex1543         DESTIN_hex1544  
             16.03747               16.03281               15.28209  
       DESTIN_hex1546         DESTIN_hex1547         DESTIN_hex1548  
             17.78386               14.34794               17.48345  
       DESTIN_hex1549         DESTIN_hex1550         DESTIN_hex1551  
             14.65718               16.73587               15.56303  
       DESTIN_hex1553         DESTIN_hex1554         DESTIN_hex1555  
             17.24317               17.26108               15.75489  
       DESTIN_hex1556         DESTIN_hex1557         DESTIN_hex1563  
             15.07187               17.47967               14.87263  
       DESTIN_hex1564         DESTIN_hex1565         DESTIN_hex1570  
             15.55012               15.95036               16.12173  
       DESTIN_hex1571         DESTIN_hex1572         DESTIN_hex1575  
             14.82349               15.18867               17.44411  
       DESTIN_hex1579         DESTIN_hex1583         DESTIN_hex1584  
             15.53720               15.36478               17.88059  
       DESTIN_hex1587         DESTIN_hex1588         DESTIN_hex1592  
             16.07606               16.79744               18.16684  
       DESTIN_hex1594         DESTIN_hex1602         DESTIN_hex1603  
             15.59905               13.56039               15.93855  
       DESTIN_hex1608         DESTIN_hex1609         DESTIN_hex1616  
             18.23757               17.67051               16.72603  
       DESTIN_hex1623         DESTIN_hex1630         DESTIN_hex1643  
             17.58242               15.22870               13.21342  
       DESTIN_hex1644         DESTIN_hex1665            o_biz_count  
             17.94311               17.30459               -0.10419  
       o_school_count            o_fin_count             o_hc_count  
              0.01728                0.24959                0.01680  
      o_busstop_count        o_housing_count  o_leisure_recre_count  
              0.42481                0.11145               -0.04701  
       o_retail_count        o_entertn_count       o_food_bev_count  
             -0.05542                0.11920                0.03067  
                 dist  
             -1.57648  

Degrees of Freedom: 51926 Total (i.e. Null);  51118 Residual
Null Deviance:      2.38e+08 
Residual Deviance: 28350000     AIC: 28620000

4.9 Doubly Constraint Spatial Interaction Model

In this section, we will fit a doubly constrained Spatial Interaction Model (SIM). For doubly constrained SIM, both the attractiveness at the destinations and the propulsiveness at the origins are considered. The model is typically expressed in the form of a distance function between the origin and destination.

dbcSIM_weekday_morn <- glm(formula = TOTAL_TRIPS ~ 
                ORIGIN_hex + 
                DESTIN_hex + 
                dist,
              family = poisson(link = "log"),
              data = flow_data_weekday_morn_log,
              na.action = na.exclude)

In the formula argument, we specify our response variable TOTAL_TRIPS and our explanatory variables. The explanatory variables include ORIGIN_hex, DESTIN_hex, and dist.

dbcSIM_weekday_morn

Call:  glm(formula = TOTAL_TRIPS ~ ORIGIN_hex + DESTIN_hex + dist, family = poisson(link = "log"), 
    data = flow_data_weekday_morn_log, na.action = na.exclude)

Coefficients:
   (Intercept)    ORIGIN_hex31    ORIGIN_hex39    ORIGIN_hex40    ORIGIN_hex41  
     13.616923        3.108157        1.282386        2.764515       -0.751642  
  ORIGIN_hex49    ORIGIN_hex50    ORIGIN_hex51    ORIGIN_hex52    ORIGIN_hex59  
      4.517471        2.119243        0.109137        3.183700        3.218399  
  ORIGIN_hex60    ORIGIN_hex61    ORIGIN_hex62    ORIGIN_hex63    ORIGIN_hex72  
      0.348340        2.585629        2.482757       -0.542673        0.866867  
  ORIGIN_hex73    ORIGIN_hex74    ORIGIN_hex75    ORIGIN_hex83    ORIGIN_hex84  
      0.510129        1.420133        1.437850        3.266378        2.489560  
  ORIGIN_hex85    ORIGIN_hex86    ORIGIN_hex87    ORIGIN_hex88    ORIGIN_hex89  
      1.309737        0.233333        1.498716        2.292051        2.794073  
  ORIGIN_hex96    ORIGIN_hex97    ORIGIN_hex99   ORIGIN_hex100   ORIGIN_hex101  
      3.993111        1.516809        4.051616        5.876286        6.245135  
 ORIGIN_hex112   ORIGIN_hex113   ORIGIN_hex114   ORIGIN_hex124   ORIGIN_hex125  
      1.825790        3.075366       -2.148361       -1.050485        3.154596  
 ORIGIN_hex126   ORIGIN_hex135   ORIGIN_hex136   ORIGIN_hex137   ORIGIN_hex145  
      1.085151        3.011202        6.560826        3.869734        3.021261  
 ORIGIN_hex146   ORIGIN_hex147   ORIGIN_hex155   ORIGIN_hex156   ORIGIN_hex157  
      1.320642        3.805546        1.006940        2.357705        1.549026  
 ORIGIN_hex168   ORIGIN_hex169   ORIGIN_hex170   ORIGIN_hex181   ORIGIN_hex182  
      1.622059        4.953055        2.146072        2.320082        1.339977  
 ORIGIN_hex183   ORIGIN_hex197   ORIGIN_hex198   ORIGIN_hex199   ORIGIN_hex213  
      5.278273        1.065849        1.541266        4.154037        1.778812  
 ORIGIN_hex214   ORIGIN_hex215   ORIGIN_hex231   ORIGIN_hex232   ORIGIN_hex233  
      1.885077        2.672229        0.563557        1.120968        2.437003  
 ORIGIN_hex249   ORIGIN_hex250   ORIGIN_hex252   ORIGIN_hex265   ORIGIN_hex266  
      2.503004        1.323100        1.225298        4.281566        2.575480  
 ORIGIN_hex267   ORIGIN_hex268   ORIGIN_hex269   ORIGIN_hex283   ORIGIN_hex284  
      7.297937        3.969403        3.420953        0.833831        3.480314  
 ORIGIN_hex286   ORIGIN_hex287   ORIGIN_hex300   ORIGIN_hex301   ORIGIN_hex302  
      2.571749        1.992990        2.601021        2.946429        3.501185  
 ORIGIN_hex303   ORIGIN_hex304   ORIGIN_hex319   ORIGIN_hex320   ORIGIN_hex321  
      6.302940        3.363259        3.937064        4.048172        5.509173  
 ORIGIN_hex322   ORIGIN_hex323   ORIGIN_hex334   ORIGIN_hex335   ORIGIN_hex336  
      3.093915        0.798616        0.360817        3.328856        3.573313  
 ORIGIN_hex337   ORIGIN_hex339   ORIGIN_hex340   ORIGIN_hex351   ORIGIN_hex352  
      6.347291        3.438284        5.051709        5.189642        2.141634  
 ORIGIN_hex353   ORIGIN_hex354   ORIGIN_hex355   ORIGIN_hex356   ORIGIN_hex357  
      5.475870        6.606664        2.855658        0.887057        0.852339  
 ORIGIN_hex367   ORIGIN_hex368   ORIGIN_hex369   ORIGIN_hex370   ORIGIN_hex371  
      2.349429        2.299380        3.004457        7.049873        6.500478  
 ORIGIN_hex373   ORIGIN_hex374   ORIGIN_hex375   ORIGIN_hex376   ORIGIN_hex377  
      1.456174        1.430720        3.141643        1.640500        2.437582  
 ORIGIN_hex385   ORIGIN_hex386   ORIGIN_hex387   ORIGIN_hex388   ORIGIN_hex390  
     -1.649634        1.565683        2.842534        6.211599        0.992620  
 ORIGIN_hex393   ORIGIN_hex394   ORIGIN_hex395   ORIGIN_hex402   ORIGIN_hex403  
      3.559711        4.982268        2.204878        2.232645        2.583991  
 ORIGIN_hex404   ORIGIN_hex405   ORIGIN_hex407   ORIGIN_hex411   ORIGIN_hex412  
      7.804138        5.784762       -0.700720        1.524585        2.083496  
 ORIGIN_hex413   ORIGIN_hex419   ORIGIN_hex420   ORIGIN_hex421   ORIGIN_hex422  
      5.297753        2.422578        3.409557        2.423697        6.340159  
 ORIGIN_hex424   ORIGIN_hex430   ORIGIN_hex437   ORIGIN_hex438   ORIGIN_hex439  
      0.676274        2.068597        2.158178        4.259282        4.965663  
 ORIGIN_hex440   ORIGIN_hex442   ORIGIN_hex453   ORIGIN_hex454   ORIGIN_hex455  
      5.488988        3.424790        2.563508        1.031783        2.994377  
 ORIGIN_hex456   ORIGIN_hex471   ORIGIN_hex472   ORIGIN_hex473   ORIGIN_hex474  
      7.074776        4.218739        6.079784        5.711551        6.801711  
 ORIGIN_hex476   ORIGIN_hex487   ORIGIN_hex488   ORIGIN_hex489   ORIGIN_hex490  
      6.396342        4.594346        2.807507        6.352599        4.941993  
 ORIGIN_hex504   ORIGIN_hex505   ORIGIN_hex506   ORIGIN_hex508   ORIGIN_hex518  
      5.122761        5.919770        6.611424        2.386124        3.372878  
 ORIGIN_hex521   ORIGIN_hex522   ORIGIN_hex524   ORIGIN_hex533   ORIGIN_hex534  
      5.743532        2.026695        2.640870        2.533237        4.904280  
 ORIGIN_hex536   ORIGIN_hex537   ORIGIN_hex539   ORIGIN_hex549   ORIGIN_hex550  
      5.754481        6.114337        6.396797        6.324043        6.150883  
 ORIGIN_hex551   ORIGIN_hex552   ORIGIN_hex554   ORIGIN_hex555   ORIGIN_hex559  
      6.645373        6.435831        7.936206        1.621963        2.204942  
 ORIGIN_hex562   ORIGIN_hex564   ORIGIN_hex565   ORIGIN_hex566   ORIGIN_hex567  
      2.294885        3.782419        5.497732        6.237086        5.497976  
 ORIGIN_hex568   ORIGIN_hex569   ORIGIN_hex577   ORIGIN_hex579   ORIGIN_hex580  
      7.731980        5.644009        0.805500        5.239358        6.070136  
 ORIGIN_hex581   ORIGIN_hex582   ORIGIN_hex583   ORIGIN_hex584   ORIGIN_hex585  
      6.460469        6.399364        5.484094        6.315175        7.110345  
 ORIGIN_hex586   ORIGIN_hex588   ORIGIN_hex589   ORIGIN_hex593   ORIGIN_hex594  
      5.707877        2.015736        3.851516        2.602769        5.181994  
 ORIGIN_hex595   ORIGIN_hex596   ORIGIN_hex597   ORIGIN_hex598   ORIGIN_hex599  
      4.401954        6.471517        6.110269        6.967940        6.782857  
 ORIGIN_hex600   ORIGIN_hex601   ORIGIN_hex603   ORIGIN_hex604   ORIGIN_hex609  
      7.417486        6.762482        2.133127        4.377790        2.816489  
 ORIGIN_hex610   ORIGIN_hex611   ORIGIN_hex612   ORIGIN_hex613   ORIGIN_hex614  
      2.970151        4.986625        3.634936        5.399528        6.177346  
 ORIGIN_hex615   ORIGIN_hex616   ORIGIN_hex617   ORIGIN_hex618   ORIGIN_hex619  
      5.916952        6.817746        5.468504        7.716098        2.864944  
 ORIGIN_hex620   ORIGIN_hex625   ORIGIN_hex626   ORIGIN_hex627   ORIGIN_hex628  
      2.142215        2.233070        4.233454        3.411942        4.608153  
 ORIGIN_hex629   ORIGIN_hex630   ORIGIN_hex631   ORIGIN_hex632   ORIGIN_hex633  
      7.198236        6.242075        5.170560        5.090560        3.910853  
 ORIGIN_hex634   ORIGIN_hex635   ORIGIN_hex636   ORIGIN_hex643   ORIGIN_hex644  
      3.708353        1.943813        3.088617        5.154151        5.078427  
 ORIGIN_hex645   ORIGIN_hex646   ORIGIN_hex649   ORIGIN_hex650   ORIGIN_hex651  
      3.612085        6.502796        6.011781        3.679306        5.107627  
 ORIGIN_hex652   ORIGIN_hex653   ORIGIN_hex654   ORIGIN_hex659   ORIGIN_hex660  
      2.525633        1.355156        1.549869        4.844835        5.289456  
 ORIGIN_hex661   ORIGIN_hex662   ORIGIN_hex663   ORIGIN_hex665   ORIGIN_hex666  
      3.610826        4.915898        5.579789        4.254335        6.295522  
 ORIGIN_hex668   ORIGIN_hex669   ORIGIN_hex670   ORIGIN_hex676   ORIGIN_hex677  
      2.315667        4.942607        3.506751        5.605513        5.468181  
 ORIGIN_hex678   ORIGIN_hex680   ORIGIN_hex681   ORIGIN_hex682   ORIGIN_hex683  
      5.657116        3.755243        6.142685        4.724671        7.395829  
 ORIGIN_hex687   ORIGIN_hex688   ORIGIN_hex693   ORIGIN_hex694   ORIGIN_hex695  
      7.484405        3.021750        4.450179        6.287707        7.603166  
 ORIGIN_hex696   ORIGIN_hex697   ORIGIN_hex698   ORIGIN_hex699   ORIGIN_hex700  
      3.533237        4.774685        3.799294        5.859449        5.768208  
 ORIGIN_hex701   ORIGIN_hex703   ORIGIN_hex706   ORIGIN_hex711   ORIGIN_hex712  
      7.001605        1.494280        8.472036        3.522311        5.794016  
 ORIGIN_hex713   ORIGIN_hex715   ORIGIN_hex716   ORIGIN_hex718   ORIGIN_hex722  
      4.331849        5.530903        4.913303        6.155446        5.020036  
 ORIGIN_hex723   ORIGIN_hex729   ORIGIN_hex730   ORIGIN_hex731   ORIGIN_hex732  
      5.154208        4.249488       -0.676706        4.791285        4.313797  
 ORIGIN_hex733   ORIGIN_hex735   ORIGIN_hex736   ORIGIN_hex737   ORIGIN_hex739  
      5.737168        3.652904        7.470399        6.748144        3.643431  
 ORIGIN_hex741   ORIGIN_hex742   ORIGIN_hex746   ORIGIN_hex747   ORIGIN_hex748  
      6.564464        5.719904        4.277217        2.809785        5.767287  
 ORIGIN_hex749   ORIGIN_hex750   ORIGIN_hex751   ORIGIN_hex753   ORIGIN_hex754  
      4.576561        3.697110        4.840363        5.808926        5.356103  
 ORIGIN_hex758   ORIGIN_hex759   ORIGIN_hex760   ORIGIN_hex764   ORIGIN_hex766  
      4.812751        5.777508        2.167080        6.112824        5.353553  
 ORIGIN_hex767   ORIGIN_hex769   ORIGIN_hex775   ORIGIN_hex777   ORIGIN_hex778  
      4.693406        4.654197        3.987131        5.543328        5.024799  
 ORIGIN_hex782   ORIGIN_hex783   ORIGIN_hex784   ORIGIN_hex785   ORIGIN_hex786  
      2.168065        4.764671        5.856641        3.414738        6.634781  
 ORIGIN_hex794   ORIGIN_hex795   ORIGIN_hex796   ORIGIN_hex799   ORIGIN_hex800  
      2.810848        7.837061        6.321947        4.423156        4.556793  
 ORIGIN_hex801   ORIGIN_hex802   ORIGIN_hex810   ORIGIN_hex812   ORIGIN_hex813  
      3.397677        4.069969        0.006596        5.809800        4.718843  
 ORIGIN_hex816   ORIGIN_hex817   ORIGIN_hex818   ORIGIN_hex819   ORIGIN_hex820  
      4.675665        4.371035        2.823024        6.355046        4.110540  
 ORIGIN_hex821   ORIGIN_hex827   ORIGIN_hex829   ORIGIN_hex830   ORIGIN_hex831  
      4.665753        3.011651        4.472325        5.992520        5.154307  
 ORIGIN_hex835   ORIGIN_hex836   ORIGIN_hex837   ORIGIN_hex838   ORIGIN_hex847  
      3.609314        4.812077        4.295062        4.722881        6.141961  
 ORIGIN_hex848   ORIGIN_hex849   ORIGIN_hex851   ORIGIN_hex853   ORIGIN_hex854  
      6.046644        3.433145        3.667767        4.332216        4.224064  
 ORIGIN_hex856   ORIGIN_hex863   ORIGIN_hex864   ORIGIN_hex865   ORIGIN_hex866  
      5.409492        3.279049        3.930718        7.203848        5.597089  
 ORIGIN_hex867   ORIGIN_hex868   ORIGIN_hex869   ORIGIN_hex870   ORIGIN_hex871  
     -2.412780        2.330203        3.712496        5.249502        6.539811  
 ORIGIN_hex873   ORIGIN_hex882   ORIGIN_hex883   ORIGIN_hex884   ORIGIN_hex885  
      4.044716        6.697557        6.139965        4.549370        1.088550  
 ORIGIN_hex887   ORIGIN_hex888   ORIGIN_hex889   ORIGIN_hex890   ORIGIN_hex899  
      4.336156        5.212590        4.628424        4.638126        3.311433  
 ORIGIN_hex901   ORIGIN_hex902   ORIGIN_hex903   ORIGIN_hex905   ORIGIN_hex906  
      5.901097        5.543477        3.357407        5.347449        4.608512  
 ORIGIN_hex907   ORIGIN_hex909   ORIGIN_hex910   ORIGIN_hex917   ORIGIN_hex920  
      5.599818        5.496417        4.832996        1.712665        6.300146  
 ORIGIN_hex922   ORIGIN_hex925   ORIGIN_hex926   ORIGIN_hex927   ORIGIN_hex928  
      2.824797        5.054287        5.194211        5.032163        2.874891  
 ORIGIN_hex929   ORIGIN_hex936   ORIGIN_hex937   ORIGIN_hex940   ORIGIN_hex941  
      4.564464        3.667964        2.863301        5.264751        4.598075  
 ORIGIN_hex944   ORIGIN_hex945   ORIGIN_hex946   ORIGIN_hex947   ORIGIN_hex949  
      4.127775        5.042834        4.904495        3.245281        4.255790  
 ORIGIN_hex955   ORIGIN_hex959   ORIGIN_hex960   ORIGIN_hex962   ORIGIN_hex963  
      2.492899        5.806873        6.090583        2.587150        5.030036  
 ORIGIN_hex964   ORIGIN_hex965   ORIGIN_hex966   ORIGIN_hex968   ORIGIN_hex969  
      5.094024        6.076668        3.568290        4.882531        1.889541  
 ORIGIN_hex974   ORIGIN_hex975   ORIGIN_hex978   ORIGIN_hex979   ORIGIN_hex980  
      0.277375        5.157647        3.599007        7.311119        4.913297  
 ORIGIN_hex983   ORIGIN_hex984   ORIGIN_hex985   ORIGIN_hex986   ORIGIN_hex989  
      6.092696        4.561877        4.001677        4.602953        2.429395  
 ORIGIN_hex993   ORIGIN_hex994   ORIGIN_hex995   ORIGIN_hex996   ORIGIN_hex998  
      0.896046        6.747206        2.801903        1.715330        6.128571  
 ORIGIN_hex999  ORIGIN_hex1002  ORIGIN_hex1004  ORIGIN_hex1005  ORIGIN_hex1006  
      5.581576        0.453172        5.602553        6.476839        3.797241  
ORIGIN_hex1008  ORIGIN_hex1013  ORIGIN_hex1015  ORIGIN_hex1016  ORIGIN_hex1017  
      5.885483        4.739547        4.532675        3.121235        5.447631  
ORIGIN_hex1018  ORIGIN_hex1019  ORIGIN_hex1023  ORIGIN_hex1024  ORIGIN_hex1025  
      5.207965        5.636500        3.988803        5.673004        5.209754  
ORIGIN_hex1026  ORIGIN_hex1027  ORIGIN_hex1028  ORIGIN_hex1029  ORIGIN_hex1031  
      4.521470        4.284296        1.721053        0.219987        4.630951  
ORIGIN_hex1032  ORIGIN_hex1034  ORIGIN_hex1035  ORIGIN_hex1036  ORIGIN_hex1037  
      5.003078        2.867719        1.572434        4.993633        7.352428  
ORIGIN_hex1038  ORIGIN_hex1039  ORIGIN_hex1044  ORIGIN_hex1045  ORIGIN_hex1046  
      5.975796        3.043416        4.834171        5.088752        4.516462  
ORIGIN_hex1047  ORIGIN_hex1048  ORIGIN_hex1051  ORIGIN_hex1052  ORIGIN_hex1053  
      3.916671        3.674640        5.373200        4.765551        4.264612  
ORIGIN_hex1056  ORIGIN_hex1057  ORIGIN_hex1058  ORIGIN_hex1059  ORIGIN_hex1063  
      7.485690        5.747987        5.554830        6.873288        1.076369  
ORIGIN_hex1065  ORIGIN_hex1067  ORIGIN_hex1068  ORIGIN_hex1069  ORIGIN_hex1070  
      2.684223        4.944552        3.896049        4.925303        5.368740  
ORIGIN_hex1071  ORIGIN_hex1072  ORIGIN_hex1073  ORIGIN_hex1075  ORIGIN_hex1076  
      5.319544        5.832816        3.654284        3.749801        6.009215  
ORIGIN_hex1077  ORIGIN_hex1078  ORIGIN_hex1079  ORIGIN_hex1083  ORIGIN_hex1085  
      6.730801        5.890375        4.810417        5.184913        4.400650  
ORIGIN_hex1086  ORIGIN_hex1088  ORIGIN_hex1089  ORIGIN_hex1090  ORIGIN_hex1091  
      5.527132        3.800116        3.399453        5.018021        6.105192  
ORIGIN_hex1092  ORIGIN_hex1093  ORIGIN_hex1095  ORIGIN_hex1096  ORIGIN_hex1097  
      6.157005        4.648733        6.744666        7.580549        6.135281  
ORIGIN_hex1099  ORIGIN_hex1103  ORIGIN_hex1104  ORIGIN_hex1106  ORIGIN_hex1107  
      6.103983        3.230693        4.232010        5.230622        6.095340  
ORIGIN_hex1108  ORIGIN_hex1109  ORIGIN_hex1110  ORIGIN_hex1111  ORIGIN_hex1112  
      5.280077        4.946745        5.478459        5.395796        5.257270  
ORIGIN_hex1115  ORIGIN_hex1116  ORIGIN_hex1124  ORIGIN_hex1125  ORIGIN_hex1126  
      6.602856        7.742905        4.186497        5.306018        6.712183  
ORIGIN_hex1127  ORIGIN_hex1128  ORIGIN_hex1129  ORIGIN_hex1130  ORIGIN_hex1131  
      3.799982        6.635490        6.276757        6.940560        3.168224  
ORIGIN_hex1133  ORIGIN_hex1134  ORIGIN_hex1142  ORIGIN_hex1143  ORIGIN_hex1144  
      7.095715        7.176635        6.051460        5.088259        4.684013  
ORIGIN_hex1145  ORIGIN_hex1146  ORIGIN_hex1147  ORIGIN_hex1148  ORIGIN_hex1149  
      5.637105        6.211563        5.469014        4.917357        2.431127  
ORIGIN_hex1152  ORIGIN_hex1153  ORIGIN_hex1161  ORIGIN_hex1162  ORIGIN_hex1163  
      6.291306        6.412164        3.256668        5.778929        5.663600  
ORIGIN_hex1164  ORIGIN_hex1165  ORIGIN_hex1166  ORIGIN_hex1168  ORIGIN_hex1171  
      5.809170        4.683536        6.895264        4.267033        7.201534  
ORIGIN_hex1178  ORIGIN_hex1179  ORIGIN_hex1180  ORIGIN_hex1181  ORIGIN_hex1182  
      4.933274        5.124088        5.940962        5.432343        6.158984  
ORIGIN_hex1183  ORIGIN_hex1187  ORIGIN_hex1194  ORIGIN_hex1196  ORIGIN_hex1197  
      5.934290        5.277965        2.831195        4.618703        7.387951  
ORIGIN_hex1198  ORIGIN_hex1199  ORIGIN_hex1200  ORIGIN_hex1202  ORIGIN_hex1203  
      5.155471        2.882618        6.273532        4.802661        3.855351  
ORIGIN_hex1205  ORIGIN_hex1212  ORIGIN_hex1213  ORIGIN_hex1214  ORIGIN_hex1215  
      4.918812        4.736029        5.822503        5.289567        4.395017  
ORIGIN_hex1216  ORIGIN_hex1217  ORIGIN_hex1218  ORIGIN_hex1220  ORIGIN_hex1221  
      4.188166        3.650315        3.045945        1.292917        2.992053  
ORIGIN_hex1226  ORIGIN_hex1227  ORIGIN_hex1228  ORIGIN_hex1229  ORIGIN_hex1230  
      4.205201        3.533404        6.442040        5.619445        3.671046  
ORIGIN_hex1231  ORIGIN_hex1232  ORIGIN_hex1233  ORIGIN_hex1234  ORIGIN_hex1235  
      4.672352        4.754175        4.304192        3.136180        2.465481  
ORIGIN_hex1236  ORIGIN_hex1243  ORIGIN_hex1244  ORIGIN_hex1245  ORIGIN_hex1246  
      1.363680        2.876792        6.339869        5.848773        5.611092  
ORIGIN_hex1247  ORIGIN_hex1248  ORIGIN_hex1249  ORIGIN_hex1251  ORIGIN_hex1252  
      5.286027        3.532790        5.047053        2.972384        2.501188  
ORIGIN_hex1257  ORIGIN_hex1258  ORIGIN_hex1259  ORIGIN_hex1260  ORIGIN_hex1261  
      5.694904        5.911076        4.779099        5.216067        4.526783  
ORIGIN_hex1262  ORIGIN_hex1263  ORIGIN_hex1264  ORIGIN_hex1265  ORIGIN_hex1266  
      5.835086        6.229764        4.413197        6.519695        6.712137  
ORIGIN_hex1267  ORIGIN_hex1272  ORIGIN_hex1273  ORIGIN_hex1274  ORIGIN_hex1275  
      4.602652        3.405355        4.661204        3.838529        4.533025  
ORIGIN_hex1276  ORIGIN_hex1277  ORIGIN_hex1278  ORIGIN_hex1279  ORIGIN_hex1280  
      6.622510        5.406593        6.634957        5.418719        6.000338  
ORIGIN_hex1281  ORIGIN_hex1285  ORIGIN_hex1286  ORIGIN_hex1287  ORIGIN_hex1288  
      2.057143        0.674091        5.415655        4.320850        5.474090  
ORIGIN_hex1289  ORIGIN_hex1290  ORIGIN_hex1291  ORIGIN_hex1292  ORIGIN_hex1293  
      4.577832        4.726606        5.982332        6.107349        6.317009  
ORIGIN_hex1299  ORIGIN_hex1300  ORIGIN_hex1301  ORIGIN_hex1302  ORIGIN_hex1303  
      5.062059        6.094828        4.851339        3.370373        5.255177  
ORIGIN_hex1305  ORIGIN_hex1306  ORIGIN_hex1307  ORIGIN_hex1312  ORIGIN_hex1313  
      6.724970        6.749458        6.769132        5.213089        5.996087  
ORIGIN_hex1314  ORIGIN_hex1315  ORIGIN_hex1316  ORIGIN_hex1317  ORIGIN_hex1318  
      4.673893        5.104713        3.343826        5.798451        5.897398  
ORIGIN_hex1319  ORIGIN_hex1320  ORIGIN_hex1326  ORIGIN_hex1327  ORIGIN_hex1328  
      6.086378        6.852998        4.714199        5.558754        4.225752  
ORIGIN_hex1329  ORIGIN_hex1330  ORIGIN_hex1331  ORIGIN_hex1332  ORIGIN_hex1333  
      6.072341        6.553098        6.141622        5.394134        6.290751  
ORIGIN_hex1336  ORIGIN_hex1337  ORIGIN_hex1338  ORIGIN_hex1339  ORIGIN_hex1340  
      4.322423        5.095634        5.550748        3.746325        2.198248  
ORIGIN_hex1341  ORIGIN_hex1342  ORIGIN_hex1343  ORIGIN_hex1344  ORIGIN_hex1345  
      5.464324        6.757933        6.050359        6.546974        7.625523  
ORIGIN_hex1348  ORIGIN_hex1349  ORIGIN_hex1350  ORIGIN_hex1351  ORIGIN_hex1352  
      4.834591        5.320905        3.584154        3.109326        1.088784  
ORIGIN_hex1353  ORIGIN_hex1354  ORIGIN_hex1355  ORIGIN_hex1356  ORIGIN_hex1357  
      6.298465        6.111035        6.642484        5.914339        6.447298  
ORIGIN_hex1359  ORIGIN_hex1360  ORIGIN_hex1362  ORIGIN_hex1363  ORIGIN_hex1365  
      3.148806        5.374744        4.860817        2.563830        6.227816  
ORIGIN_hex1366  ORIGIN_hex1367  ORIGIN_hex1368  ORIGIN_hex1369  ORIGIN_hex1370  
      5.924298        6.770207        7.084605        5.108004        5.338646  
ORIGIN_hex1371  ORIGIN_hex1372  ORIGIN_hex1373  ORIGIN_hex1374  ORIGIN_hex1375  
      5.595088        6.083336        3.201310        3.238688        2.657040  
ORIGIN_hex1376  ORIGIN_hex1377  ORIGIN_hex1378  ORIGIN_hex1379  ORIGIN_hex1382  
      6.387990        6.568276        6.859141        5.166307        4.812123  
ORIGIN_hex1383  ORIGIN_hex1384  ORIGIN_hex1388  ORIGIN_hex1389  ORIGIN_hex1390  
      5.941699        4.944346        5.982516        7.656599        7.029447  
ORIGIN_hex1391  ORIGIN_hex1392  ORIGIN_hex1393  ORIGIN_hex1394  ORIGIN_hex1395  
      6.388524        5.759311        5.057960        4.070232        2.580886  
ORIGIN_hex1397  ORIGIN_hex1399  ORIGIN_hex1400  ORIGIN_hex1401  ORIGIN_hex1402  
      3.595449        6.162915        6.034858        3.629365        4.633325  
ORIGIN_hex1404  ORIGIN_hex1405  ORIGIN_hex1406  ORIGIN_hex1409  ORIGIN_hex1410  
      5.009325        5.598983        6.232842        4.362552       -0.162738  
ORIGIN_hex1411  ORIGIN_hex1412  ORIGIN_hex1413  ORIGIN_hex1414  ORIGIN_hex1415  
      5.850066        6.047567        2.173233        5.496955        3.069481  
ORIGIN_hex1416  ORIGIN_hex1417  ORIGIN_hex1420  ORIGIN_hex1422  ORIGIN_hex1426  
      4.733961        4.849896       -0.561518        6.129023        4.975477  
ORIGIN_hex1427  ORIGIN_hex1428  ORIGIN_hex1429  ORIGIN_hex1432  ORIGIN_hex1433  
      4.202285        5.085925        3.510367        1.313440        4.880805  
ORIGIN_hex1434  ORIGIN_hex1437  ORIGIN_hex1438  ORIGIN_hex1439  ORIGIN_hex1442  
      6.751362        4.319667        5.954476        5.841735        5.011017  
ORIGIN_hex1444  ORIGIN_hex1446  ORIGIN_hex1447  ORIGIN_hex1448  ORIGIN_hex1450  
      6.668492        5.180672        6.050154        5.619075        0.308803  
ORIGIN_hex1451  ORIGIN_hex1456  ORIGIN_hex1457  ORIGIN_hex1458  ORIGIN_hex1459  
      2.436820        4.211080        6.217279        5.001105        6.092825  
ORIGIN_hex1460  ORIGIN_hex1461  ORIGIN_hex1465  ORIGIN_hex1466  ORIGIN_hex1467  
      4.439191        4.878575        5.083938        5.946808        6.035122  
ORIGIN_hex1468  ORIGIN_hex1469  ORIGIN_hex1470  ORIGIN_hex1471  ORIGIN_hex1475  
      5.171141        6.325169        4.985384        5.862115        5.132027  
ORIGIN_hex1476  ORIGIN_hex1477  ORIGIN_hex1478  ORIGIN_hex1479  ORIGIN_hex1480  
      5.709415        4.585918        5.637774        5.992637        5.796694  
ORIGIN_hex1481  ORIGIN_hex1484  ORIGIN_hex1485  ORIGIN_hex1486  ORIGIN_hex1487  
      3.574712        5.635757        5.734097        5.529503        5.856408  
ORIGIN_hex1488  ORIGIN_hex1489  ORIGIN_hex1491  ORIGIN_hex1492  ORIGIN_hex1493  
      5.581573        5.815972        5.178396        6.013572        2.293219  
ORIGIN_hex1494  ORIGIN_hex1495  ORIGIN_hex1496  ORIGIN_hex1497  ORIGIN_hex1499  
      6.744280        5.691858        6.349061        3.298486        5.814802  
ORIGIN_hex1500  ORIGIN_hex1501  ORIGIN_hex1502  ORIGIN_hex1503  ORIGIN_hex1504  
      3.758283        4.496083        5.984023        4.158731        4.810434  
ORIGIN_hex1506  ORIGIN_hex1507  ORIGIN_hex1508  ORIGIN_hex1509  ORIGIN_hex1510  
      4.807011        6.409430        5.288863        5.371370        5.208048  
ORIGIN_hex1511  ORIGIN_hex1513  ORIGIN_hex1514  ORIGIN_hex1515  ORIGIN_hex1516  
      6.639534        3.075866        4.924024        3.863231        5.449857  
ORIGIN_hex1517  ORIGIN_hex1518  ORIGIN_hex1522  ORIGIN_hex1523  ORIGIN_hex1524  
      6.075965        5.984041        4.046809        5.759634        5.748298  
ORIGIN_hex1525  ORIGIN_hex1528  ORIGIN_hex1529  ORIGIN_hex1530  ORIGIN_hex1531  
      5.990897        4.676222        5.162629        6.091706        6.096389  
ORIGIN_hex1532  ORIGIN_hex1534  ORIGIN_hex1535  ORIGIN_hex1536  ORIGIN_hex1537  
      5.874469        1.759580        4.564342        4.813797        5.775810  
ORIGIN_hex1538  ORIGIN_hex1540  ORIGIN_hex1541  ORIGIN_hex1542  ORIGIN_hex1543  
      5.906891        2.152557        4.810922        6.035864        5.090731  
ORIGIN_hex1544  ORIGIN_hex1546  ORIGIN_hex1547  ORIGIN_hex1548  ORIGIN_hex1549  
      5.333651        2.153984        0.899748        2.888695        4.062877  
ORIGIN_hex1550  ORIGIN_hex1551  ORIGIN_hex1553  ORIGIN_hex1554  ORIGIN_hex1555  
      4.865783        1.995477        3.096286        4.157224        3.473194  
ORIGIN_hex1556  ORIGIN_hex1557  ORIGIN_hex1563  ORIGIN_hex1564  ORIGIN_hex1565  
      3.807251        2.259716        3.786958        3.494627        2.996990  
ORIGIN_hex1570  ORIGIN_hex1571  ORIGIN_hex1572  ORIGIN_hex1575  ORIGIN_hex1579  
      4.808206        1.945338        2.915020        5.805359        4.020119  
ORIGIN_hex1583  ORIGIN_hex1584  ORIGIN_hex1587  ORIGIN_hex1588  ORIGIN_hex1592  
      3.628316        5.501597        4.904405        4.978869        5.042713  
ORIGIN_hex1594  ORIGIN_hex1602  ORIGIN_hex1603  ORIGIN_hex1608  ORIGIN_hex1609  
      3.996199       -0.212174        3.805208        5.019173        4.958845  
ORIGIN_hex1616  ORIGIN_hex1623  ORIGIN_hex1630  ORIGIN_hex1643  ORIGIN_hex1644  
      2.877373        4.051563       -2.208282        4.540494        5.845861  
ORIGIN_hex1665    DESTIN_hex31    DESTIN_hex39    DESTIN_hex40    DESTIN_hex41  
      3.025064       -0.187576        2.278522        2.544351       -0.237904  
  DESTIN_hex49    DESTIN_hex50    DESTIN_hex51    DESTIN_hex52    DESTIN_hex59  
     -0.831975        1.968793        1.060073        0.972849        1.139654  
  DESTIN_hex60    DESTIN_hex61    DESTIN_hex62    DESTIN_hex63    DESTIN_hex72  
     -1.812486        0.606916        1.259920       -1.035603       -0.386674  
  DESTIN_hex73    DESTIN_hex74    DESTIN_hex75    DESTIN_hex83    DESTIN_hex84  
      1.712728        0.495647       -1.061720        0.710929       -0.142231  
  DESTIN_hex85    DESTIN_hex86    DESTIN_hex87    DESTIN_hex88    DESTIN_hex89  
      0.050692       -0.016798       -0.207337       -0.068475       -0.494837  
  DESTIN_hex96    DESTIN_hex97    DESTIN_hex99   DESTIN_hex100   DESTIN_hex101  
     -1.703752        0.059205        0.878363       -0.530372       -0.085813  
 DESTIN_hex112   DESTIN_hex113   DESTIN_hex114   DESTIN_hex124   DESTIN_hex125  
     -0.859497       -1.480781       -2.600253       -2.820572       -0.508959  
 DESTIN_hex126   DESTIN_hex135   DESTIN_hex136   DESTIN_hex137   DESTIN_hex145  
     -2.426458        1.658903       -0.275628       -0.651344       -0.525296  
 DESTIN_hex146   DESTIN_hex147   DESTIN_hex155   DESTIN_hex156   DESTIN_hex157  
     -1.532602        0.321893       -1.955133       -0.848893       -1.466001  
 DESTIN_hex168   DESTIN_hex169   DESTIN_hex170   DESTIN_hex181   DESTIN_hex182  
      1.011349       -0.489911       -0.975182        0.972728       -0.658577  
 DESTIN_hex183   DESTIN_hex197   DESTIN_hex198   DESTIN_hex199   DESTIN_hex213  
     -2.519065        0.957786       -0.381377        0.231234        0.057529  
 DESTIN_hex214   DESTIN_hex215   DESTIN_hex231   DESTIN_hex232   DESTIN_hex233  
      0.506952        0.483172       -2.815611       -1.907584        0.195582  
 DESTIN_hex249   DESTIN_hex250   DESTIN_hex252   DESTIN_hex265   DESTIN_hex266  
      0.039566       -0.678331        0.671413        0.652161        0.073165  
 DESTIN_hex267   DESTIN_hex268   DESTIN_hex269   DESTIN_hex283   DESTIN_hex284  
      0.393636        0.132072        1.439334       -1.630653       -0.175125  
 DESTIN_hex286   DESTIN_hex287   DESTIN_hex288   DESTIN_hex300   DESTIN_hex301  
     -5.007696       -0.732452       -6.341390       -0.023013        0.597229  
 DESTIN_hex302   DESTIN_hex303   DESTIN_hex304   DESTIN_hex319   DESTIN_hex320  
     -0.515704       -0.456819       -0.702850       -0.678971       -1.149451  
 DESTIN_hex321   DESTIN_hex322   DESTIN_hex323   DESTIN_hex334   DESTIN_hex335  
     -2.100774        1.825228       -6.362177       -1.759705        1.273782  
 DESTIN_hex336   DESTIN_hex337   DESTIN_hex339   DESTIN_hex340   DESTIN_hex351  
     -0.838483       -0.511374       -1.495990       -0.939236        1.491645  
 DESTIN_hex352   DESTIN_hex353   DESTIN_hex354   DESTIN_hex355   DESTIN_hex356  
     -0.391576       -0.533775       -0.242561       -2.040818       -3.428794  
 DESTIN_hex357   DESTIN_hex367   DESTIN_hex368   DESTIN_hex369   DESTIN_hex370  
     -3.597187       -0.473484       -0.740286       -1.904012        0.129137  
 DESTIN_hex371   DESTIN_hex373   DESTIN_hex374   DESTIN_hex375   DESTIN_hex377  
     -0.579523       -3.343109       -1.738363       -1.658665       -2.845712  
 DESTIN_hex385   DESTIN_hex386   DESTIN_hex387   DESTIN_hex388   DESTIN_hex390  
      1.001161        0.096877        0.043416       -1.265986       -2.708018  
 DESTIN_hex393   DESTIN_hex394   DESTIN_hex395   DESTIN_hex402   DESTIN_hex403  
     -2.686528       -0.807004       -1.634769        0.333962       -0.762848  
 DESTIN_hex404   DESTIN_hex405   DESTIN_hex407   DESTIN_hex411   DESTIN_hex412  
      1.343963       -0.987975       -3.418935       -3.763640       -3.025822  
 DESTIN_hex413   DESTIN_hex419   DESTIN_hex420   DESTIN_hex421   DESTIN_hex422  
     -1.694120       -1.128288       -0.346026       -0.424975       -0.898678  
 DESTIN_hex424   DESTIN_hex430   DESTIN_hex437   DESTIN_hex438   DESTIN_hex439  
     -5.709741       -3.647132       -1.566824       -1.126878       -1.635478  
 DESTIN_hex440   DESTIN_hex442   DESTIN_hex453   DESTIN_hex454   DESTIN_hex455  
     -1.781536       -1.043359        0.030305       -3.000408       -1.330545  
 DESTIN_hex456   DESTIN_hex471   DESTIN_hex472   DESTIN_hex473   DESTIN_hex474  
      1.034798       -0.213517        0.102928       -1.080671        0.079060  
 DESTIN_hex476   DESTIN_hex487   DESTIN_hex488   DESTIN_hex489   DESTIN_hex490  
     -0.930355        0.679860       -1.829050       -0.030506       -2.560693  
 DESTIN_hex504   DESTIN_hex505   DESTIN_hex506   DESTIN_hex508   DESTIN_hex518  
     -1.430268       -2.844977       -0.357997       -1.942458       -0.776971  
 DESTIN_hex521   DESTIN_hex522   DESTIN_hex524   DESTIN_hex533   DESTIN_hex534  
     -0.561137       -3.010794       -4.083158        0.756328        0.171510  
 DESTIN_hex536   DESTIN_hex537   DESTIN_hex539   DESTIN_hex549   DESTIN_hex550  
     -0.537185       -1.059692       -3.023655       -0.674295       -0.257481  
 DESTIN_hex551   DESTIN_hex552   DESTIN_hex554   DESTIN_hex555   DESTIN_hex559  
     -0.321796       -0.801919       -1.387247       -3.689474       -1.372026  
 DESTIN_hex562   DESTIN_hex564   DESTIN_hex565   DESTIN_hex566   DESTIN_hex567  
     -0.295076       -1.595243       -1.406230       -0.934724       -2.354647  
 DESTIN_hex568   DESTIN_hex569   DESTIN_hex577   DESTIN_hex579   DESTIN_hex580  
     -1.701569       -2.933371       -0.505739       -0.658553        0.949814  
 DESTIN_hex581   DESTIN_hex582   DESTIN_hex583   DESTIN_hex584   DESTIN_hex585  
     -0.888170       -1.588609       -4.040085       -1.435376       -1.136580  
 DESTIN_hex586   DESTIN_hex588   DESTIN_hex589   DESTIN_hex593   DESTIN_hex594  
     -2.049028       -0.398305        0.177980       -1.433955       -0.914339  
 DESTIN_hex595   DESTIN_hex596   DESTIN_hex597   DESTIN_hex598   DESTIN_hex599  
      0.297195       -1.180197       -0.492082       -1.294776       -1.480038  
 DESTIN_hex600   DESTIN_hex601   DESTIN_hex603   DESTIN_hex604   DESTIN_hex609  
      0.615211       -0.022594       -1.641160       -1.001708       -0.139007  
 DESTIN_hex610   DESTIN_hex611   DESTIN_hex612   DESTIN_hex613   DESTIN_hex614  
      0.456000       -1.342586       -0.167488       -1.327837        0.081230  
 DESTIN_hex615   DESTIN_hex616   DESTIN_hex617   DESTIN_hex618   DESTIN_hex619  
     -1.484294       -0.778361       -2.515123       -1.500650       -0.064653  
 DESTIN_hex620   DESTIN_hex625   DESTIN_hex626   DESTIN_hex627   DESTIN_hex628  
     -0.947770       -0.626885       -0.785043        0.593832        0.696592  
 DESTIN_hex629   DESTIN_hex630   DESTIN_hex631   DESTIN_hex632   DESTIN_hex633  
      0.172336       -2.930094       -1.042349       -3.160708       -2.513428  
 DESTIN_hex634   DESTIN_hex635   DESTIN_hex636   DESTIN_hex643   DESTIN_hex644  
      0.423642       -3.733362       -1.270835        0.213558       -1.735984  
 DESTIN_hex645   DESTIN_hex646   DESTIN_hex649   DESTIN_hex650   DESTIN_hex651  
      0.160192       -0.358780       -1.226304       -2.651879        0.640828  
 DESTIN_hex652   DESTIN_hex653   DESTIN_hex654   DESTIN_hex659   DESTIN_hex660  
     -3.256495       -1.617044       -1.778259       -0.301402       -0.741540  
 DESTIN_hex661   DESTIN_hex662   DESTIN_hex663   DESTIN_hex665   DESTIN_hex666  
     -0.252528        1.039575       -1.263705       -2.995773       -1.372388  
 DESTIN_hex668   DESTIN_hex669   DESTIN_hex670   DESTIN_hex676   DESTIN_hex677  
     -2.468633       -1.483162       -4.785086       -0.444806       -1.568342  
 DESTIN_hex678   DESTIN_hex680   DESTIN_hex681   DESTIN_hex682   DESTIN_hex683  
     -0.852887       -2.141149       -0.650363       -0.840485        0.886908  
 DESTIN_hex687   DESTIN_hex688   DESTIN_hex693   DESTIN_hex694   DESTIN_hex695  
      1.755743       -1.882406       -0.537605        0.172666        1.731014  
 DESTIN_hex696   DESTIN_hex697   DESTIN_hex698   DESTIN_hex699   DESTIN_hex700  
     -0.794165       -0.988788       -2.321381        0.317259       -2.510337  
 DESTIN_hex701   DESTIN_hex703   DESTIN_hex706   DESTIN_hex711   DESTIN_hex712  
     -1.252065       -0.440214        1.595070        0.649327       -0.419697  
 DESTIN_hex713   DESTIN_hex715   DESTIN_hex716   DESTIN_hex718   DESTIN_hex722  
     -1.101686       -0.554939       -2.578140       -1.663164       -1.947222  
 DESTIN_hex723   DESTIN_hex729   DESTIN_hex730   DESTIN_hex731   DESTIN_hex732  
     -1.940415       -0.028209       -0.118156       -1.914752        1.749286  
 DESTIN_hex733   DESTIN_hex735   DESTIN_hex736   DESTIN_hex737   DESTIN_hex739  
      0.958338       -1.376483       -0.056777       -1.999456       -0.850940  
 DESTIN_hex741   DESTIN_hex742   DESTIN_hex746   DESTIN_hex747   DESTIN_hex748  
      0.300068       -1.486463        0.892643        0.530864        0.219221  
 DESTIN_hex749   DESTIN_hex750   DESTIN_hex751   DESTIN_hex753   DESTIN_hex754  
     -1.407708        1.075039       -0.913603       -2.123474       -4.621326  
 DESTIN_hex758   DESTIN_hex759   DESTIN_hex760   DESTIN_hex764   DESTIN_hex766  
     -1.568644       -1.367470       -5.081470        1.108043        0.065792  
 DESTIN_hex767   DESTIN_hex769   DESTIN_hex775   DESTIN_hex777   DESTIN_hex778  
     -1.471439       -0.454027        0.217420       -1.462736       -0.728886  
 DESTIN_hex782   DESTIN_hex783   DESTIN_hex784   DESTIN_hex785   DESTIN_hex786  
      0.297740        0.560241       -0.697202       -2.268227       -1.120786  
 DESTIN_hex794   DESTIN_hex795   DESTIN_hex796   DESTIN_hex799   DESTIN_hex800  
     -4.140801        1.826242       -0.758004       -1.100986        0.688775  
 DESTIN_hex801   DESTIN_hex802   DESTIN_hex810   DESTIN_hex812   DESTIN_hex813  
     -1.427141       -1.263053       -3.601536       -0.647000       -1.209652  
 DESTIN_hex816   DESTIN_hex817   DESTIN_hex818   DESTIN_hex819   DESTIN_hex820  
     -0.108042        0.232969        0.467277        0.948886       -2.393455  
 DESTIN_hex821   DESTIN_hex827   DESTIN_hex829   DESTIN_hex830   DESTIN_hex831  
     -0.840801        0.885495       -0.208606       -1.478141        0.483431  
 DESTIN_hex835   DESTIN_hex836   DESTIN_hex837   DESTIN_hex838   DESTIN_hex847  
      0.175686       -1.457707       -1.288210       -1.763097       -1.372625  
 DESTIN_hex848   DESTIN_hex849   DESTIN_hex851   DESTIN_hex853   DESTIN_hex854  
     -1.258366        0.118397        1.399892       -0.362203       -0.973155  
 DESTIN_hex856   DESTIN_hex863   DESTIN_hex864   DESTIN_hex865   DESTIN_hex866  
     -0.280662       -1.368552       -2.614512        0.790513        0.167787  
 DESTIN_hex867   DESTIN_hex868   DESTIN_hex869   DESTIN_hex870   DESTIN_hex871  
     -0.336224       -0.554061       -0.348172       -0.604915        0.993697  
 DESTIN_hex873   DESTIN_hex882   DESTIN_hex883   DESTIN_hex884   DESTIN_hex885  
     -0.632120       -0.235719       -1.159151        0.275172       -1.141521  
 DESTIN_hex887   DESTIN_hex888   DESTIN_hex889   DESTIN_hex890   DESTIN_hex899  
      1.474487        0.599324       -0.833864       -1.323280       -2.312346  
 DESTIN_hex901   DESTIN_hex902   DESTIN_hex903   DESTIN_hex905   DESTIN_hex906  
     -0.709827       -0.295724        0.071707       -0.072823       -0.347068  
 DESTIN_hex907   DESTIN_hex909   DESTIN_hex910   DESTIN_hex917   DESTIN_hex920  
      0.141356       -0.131289       -1.066922       -4.400286       -0.804284  
 DESTIN_hex922   DESTIN_hex925   DESTIN_hex926   DESTIN_hex927   DESTIN_hex928  
      0.391778       -0.718079        0.809534       -0.993910       -1.335858  
 DESTIN_hex929   DESTIN_hex936   DESTIN_hex937   DESTIN_hex940   DESTIN_hex941  
     -0.759869       -2.373193       -1.556308        0.610909        0.461015  
 DESTIN_hex944   DESTIN_hex945   DESTIN_hex946   DESTIN_hex947   DESTIN_hex949  
     -0.624114        0.976707        0.253136       -1.554973       -0.792826  
 DESTIN_hex955   DESTIN_hex959   DESTIN_hex960   DESTIN_hex962   DESTIN_hex963  
     -4.903935       -0.570538       -1.334225       -0.654570       -0.355887  
 DESTIN_hex964   DESTIN_hex965   DESTIN_hex966   DESTIN_hex968   DESTIN_hex969  
     -0.120152        0.848161       -0.681642        0.066104       -1.941383  
 DESTIN_hex974   DESTIN_hex975   DESTIN_hex978   DESTIN_hex979   DESTIN_hex980  
     -5.873880       -0.858957       -1.628532        0.691112       -1.087186  
 DESTIN_hex982   DESTIN_hex983   DESTIN_hex984   DESTIN_hex985   DESTIN_hex986  
     -1.473992        1.132879        1.239657       -1.004800        0.116353  
 DESTIN_hex989   DESTIN_hex993   DESTIN_hex994   DESTIN_hex995   DESTIN_hex996  
     -3.396900       -1.110005       -0.189623       -2.883963       -1.822898  
 DESTIN_hex998   DESTIN_hex999  DESTIN_hex1002  DESTIN_hex1004  DESTIN_hex1005  
     -1.372265       -1.827336        0.279787       -0.772409        0.981871  
DESTIN_hex1006  DESTIN_hex1008  DESTIN_hex1013  DESTIN_hex1015  DESTIN_hex1016  
     -1.718996        1.109555        0.854025       -1.389096       -2.545126  
DESTIN_hex1017  DESTIN_hex1018  DESTIN_hex1019  DESTIN_hex1023  DESTIN_hex1024  
     -2.130731       -1.523610       -2.163008       -0.748781       -0.671741  
DESTIN_hex1025  DESTIN_hex1026  DESTIN_hex1027  DESTIN_hex1028  DESTIN_hex1029  
     -0.416575       -0.256674       -0.610806       -1.780683       -4.337019  
DESTIN_hex1031  DESTIN_hex1032  DESTIN_hex1034  DESTIN_hex1035  DESTIN_hex1036  
     -1.205166       -0.770476       -3.891320       -3.860456       -3.410768  
DESTIN_hex1037  DESTIN_hex1038  DESTIN_hex1039  DESTIN_hex1044  DESTIN_hex1045  
      0.147540        0.097448       -2.530230       -0.937574       -0.532820  
DESTIN_hex1046  DESTIN_hex1047  DESTIN_hex1048  DESTIN_hex1051  DESTIN_hex1052  
     -0.603058       -1.805604       -1.577971       -0.095131       -2.087544  
DESTIN_hex1053  DESTIN_hex1056  DESTIN_hex1057  DESTIN_hex1058  DESTIN_hex1059  
     -1.795931        1.236606       -2.003475       -1.769629       -0.956578  
DESTIN_hex1063  DESTIN_hex1065  DESTIN_hex1067  DESTIN_hex1068  DESTIN_hex1069  
     -4.213931       -2.148724        0.004580       -0.358382       -0.480451  
DESTIN_hex1070  DESTIN_hex1071  DESTIN_hex1072  DESTIN_hex1073  DESTIN_hex1075  
     -0.191333        0.063898       -0.170140       -1.741346       -4.276327  
DESTIN_hex1076  DESTIN_hex1077  DESTIN_hex1078  DESTIN_hex1079  DESTIN_hex1083  
     -0.923426       -1.069158       -2.101923       -3.185406       -0.008527  
DESTIN_hex1085  DESTIN_hex1086  DESTIN_hex1088  DESTIN_hex1089  DESTIN_hex1090  
      0.052267        0.444581       -0.187942       -1.635748       -1.031417  
DESTIN_hex1091  DESTIN_hex1092  DESTIN_hex1093  DESTIN_hex1095  DESTIN_hex1096  
      0.023734       -0.770180       -1.777684       -0.799744        1.152111  
DESTIN_hex1097  DESTIN_hex1099  DESTIN_hex1103  DESTIN_hex1104  DESTIN_hex1106  
     -0.859875       -1.451295        0.889314       -0.316063       -0.093124  
DESTIN_hex1107  DESTIN_hex1108  DESTIN_hex1109  DESTIN_hex1110  DESTIN_hex1111  
      0.429063       -0.916129       -0.698803       -0.474979       -2.196245  
DESTIN_hex1112  DESTIN_hex1115  DESTIN_hex1116  DESTIN_hex1124  DESTIN_hex1125  
     -0.906949       -1.464549       -0.354671        0.088051        0.307905  
DESTIN_hex1126  DESTIN_hex1127  DESTIN_hex1128  DESTIN_hex1129  DESTIN_hex1130  
      1.605676       -1.409942       -0.496332       -0.179479        0.380567  
DESTIN_hex1131  DESTIN_hex1133  DESTIN_hex1134  DESTIN_hex1142  DESTIN_hex1143  
      0.261169       -1.669553       -1.358062        0.753845       -0.055452  
DESTIN_hex1144  DESTIN_hex1145  DESTIN_hex1146  DESTIN_hex1147  DESTIN_hex1148  
     -0.450346        0.021174        1.395264       -1.389281        0.356906  
DESTIN_hex1149  DESTIN_hex1152  DESTIN_hex1153  DESTIN_hex1161  DESTIN_hex1162  
      0.414702       -2.108574       -2.779994       -0.688409        0.056049  
DESTIN_hex1163  DESTIN_hex1164  DESTIN_hex1165  DESTIN_hex1166  DESTIN_hex1168  
     -0.136670       -0.627496       -1.262064        1.111341        0.986058  
DESTIN_hex1171  DESTIN_hex1178  DESTIN_hex1179  DESTIN_hex1180  DESTIN_hex1181  
     -1.498131       -1.426528       -1.016944       -0.747723       -0.936741  
DESTIN_hex1182  DESTIN_hex1183  DESTIN_hex1187  DESTIN_hex1194  DESTIN_hex1196  
     -0.005293        0.481341       -2.250765        0.965399       -1.301274  
DESTIN_hex1197  DESTIN_hex1198  DESTIN_hex1199  DESTIN_hex1200  DESTIN_hex1202  
      0.355002       -0.259856       -2.080257       -0.504153       -1.699738  
DESTIN_hex1203  DESTIN_hex1205  DESTIN_hex1212  DESTIN_hex1213  DESTIN_hex1214  
     -1.555304       -4.145981        0.067330       -0.535484       -1.963146  
DESTIN_hex1215  DESTIN_hex1216  DESTIN_hex1217  DESTIN_hex1218  DESTIN_hex1220  
     -1.288826       -1.602329       -0.624388       -4.886168       -3.638423  
DESTIN_hex1221  DESTIN_hex1226  DESTIN_hex1227  DESTIN_hex1228  DESTIN_hex1229  
     -1.691882       -0.055065       -1.333599        0.496416        0.353840  
DESTIN_hex1230  DESTIN_hex1231  DESTIN_hex1232  DESTIN_hex1233  DESTIN_hex1234  
     -1.971482       -1.624366        0.224762        0.308868       -2.270214  
DESTIN_hex1235  DESTIN_hex1236  DESTIN_hex1243  DESTIN_hex1244  DESTIN_hex1245  
     -2.094781       -3.531048        0.654340        1.159343       -0.039985  
DESTIN_hex1246  DESTIN_hex1247  DESTIN_hex1248  DESTIN_hex1249  DESTIN_hex1251  
      0.114568       -0.686034       -0.498346       -1.207343       -2.468917  
DESTIN_hex1252  DESTIN_hex1257  DESTIN_hex1258  DESTIN_hex1259  DESTIN_hex1260  
     -2.942012       -0.408880        0.374564        0.024602       -1.646119  
DESTIN_hex1261  DESTIN_hex1262  DESTIN_hex1263  DESTIN_hex1264  DESTIN_hex1265  
     -1.841832       -0.875779        0.324804        0.035140       -1.172555  
DESTIN_hex1266  DESTIN_hex1267  DESTIN_hex1272  DESTIN_hex1273  DESTIN_hex1274  
     -0.377488       -2.643385       -0.687452        0.131725        0.833503  
DESTIN_hex1275  DESTIN_hex1276  DESTIN_hex1277  DESTIN_hex1278  DESTIN_hex1279  
     -2.034147        1.385630       -1.487058        0.294141       -2.805710  
DESTIN_hex1280  DESTIN_hex1281  DESTIN_hex1285  DESTIN_hex1286  DESTIN_hex1287  
     -1.829471       -3.185007       -2.427344        0.126983       -0.403375  
DESTIN_hex1288  DESTIN_hex1289  DESTIN_hex1290  DESTIN_hex1291  DESTIN_hex1292  
      0.376118       -0.835152       -1.311672       -0.868330       -1.352454  
DESTIN_hex1293  DESTIN_hex1299  DESTIN_hex1300  DESTIN_hex1301  DESTIN_hex1302  
     -1.502707       -0.888111        0.431569        0.511868        0.050869  
DESTIN_hex1303  DESTIN_hex1305  DESTIN_hex1306  DESTIN_hex1307  DESTIN_hex1312  
     -1.259388       -0.323203       -0.886757       -2.916696       -0.097902  
DESTIN_hex1313  DESTIN_hex1314  DESTIN_hex1315  DESTIN_hex1316  DESTIN_hex1317  
      0.457769       -0.510225        0.177524       -2.274774        1.017828  
DESTIN_hex1318  DESTIN_hex1319  DESTIN_hex1320  DESTIN_hex1326  DESTIN_hex1327  
     -1.531133       -0.612148       -1.618577       -1.072228        0.531660  
DESTIN_hex1328  DESTIN_hex1329  DESTIN_hex1330  DESTIN_hex1331  DESTIN_hex1332  
      0.354887        0.137880       -1.432078       -0.440864       -2.298769  
DESTIN_hex1333  DESTIN_hex1336  DESTIN_hex1337  DESTIN_hex1338  DESTIN_hex1339  
     -2.313755       -0.593614       -0.611424        0.470173        1.209330  
DESTIN_hex1340  DESTIN_hex1341  DESTIN_hex1342  DESTIN_hex1343  DESTIN_hex1344  
     -1.194138       -0.455336        0.847071        0.289346       -0.026378  
DESTIN_hex1345  DESTIN_hex1348  DESTIN_hex1349  DESTIN_hex1350  DESTIN_hex1351  
     -1.873380       -0.311508        0.969602        1.053143       -0.117189  
DESTIN_hex1352  DESTIN_hex1353  DESTIN_hex1354  DESTIN_hex1355  DESTIN_hex1356  
      0.464980       -0.445511       -1.260269       -1.548138       -1.376470  
DESTIN_hex1357  DESTIN_hex1359  DESTIN_hex1360  DESTIN_hex1362  DESTIN_hex1363  
     -2.700981       -1.702041       -0.762592        1.075248        1.190088  
DESTIN_hex1365  DESTIN_hex1366  DESTIN_hex1367  DESTIN_hex1368  DESTIN_hex1369  
     -1.870546       -1.757798        0.161190       -0.963849       -2.805688  
DESTIN_hex1370  DESTIN_hex1371  DESTIN_hex1372  DESTIN_hex1373  DESTIN_hex1374  
      0.520915        0.797673        0.686915       -0.108649       -0.961940  
DESTIN_hex1375  DESTIN_hex1376  DESTIN_hex1377  DESTIN_hex1378  DESTIN_hex1379  
     -2.904064       -2.120654       -1.436504       -1.136107       -3.279069  
DESTIN_hex1382  DESTIN_hex1383  DESTIN_hex1384  DESTIN_hex1388  DESTIN_hex1389  
     -0.406285        0.564112        0.551784       -2.267988        0.236197  
DESTIN_hex1390  DESTIN_hex1391  DESTIN_hex1392  DESTIN_hex1393  DESTIN_hex1394  
      0.315804       -1.922500        1.003571       -0.432362       -3.103383  
DESTIN_hex1395  DESTIN_hex1397  DESTIN_hex1399  DESTIN_hex1400  DESTIN_hex1401  
     -1.709672       -0.003143       -1.959478       -2.042575       -2.545437  
DESTIN_hex1402  DESTIN_hex1404  DESTIN_hex1405  DESTIN_hex1406  DESTIN_hex1409  
     -1.658344       -1.213940        0.385384        0.861235        0.628025  
DESTIN_hex1410  DESTIN_hex1411  DESTIN_hex1412  DESTIN_hex1413  DESTIN_hex1414  
     -3.124612       -0.747080       -1.772746       -5.735420       -0.260439  
DESTIN_hex1415  DESTIN_hex1416  DESTIN_hex1417  DESTIN_hex1420  DESTIN_hex1422  
     -2.217155       -0.370310       -0.325202       -3.600508       -2.203593  
DESTIN_hex1426  DESTIN_hex1427  DESTIN_hex1428  DESTIN_hex1429  DESTIN_hex1432  
     -0.538531        0.192950        0.113722       -1.402282       -0.660051  
DESTIN_hex1433  DESTIN_hex1434  DESTIN_hex1437  DESTIN_hex1438  DESTIN_hex1439  
     -2.578219       -2.032080       -0.227039       -0.192414       -0.175418  
DESTIN_hex1442  DESTIN_hex1444  DESTIN_hex1446  DESTIN_hex1447  DESTIN_hex1448  
      0.218280       -2.113933       -0.444001        0.858567       -0.618548  
DESTIN_hex1450  DESTIN_hex1451  DESTIN_hex1456  DESTIN_hex1457  DESTIN_hex1458  
     -3.167342       -2.084260       -1.004591        1.083493       -1.926783  
DESTIN_hex1459  DESTIN_hex1460  DESTIN_hex1461  DESTIN_hex1465  DESTIN_hex1466  
     -0.096277       -1.189633        0.765159       -0.843354        0.679310  
DESTIN_hex1467  DESTIN_hex1468  DESTIN_hex1469  DESTIN_hex1470  DESTIN_hex1471  
      0.346611        0.862811       -0.492275       -0.297030        0.758185  
DESTIN_hex1475  DESTIN_hex1476  DESTIN_hex1477  DESTIN_hex1478  DESTIN_hex1479  
     -0.680713       -0.317021       -1.136572       -0.422127       -0.768994  
DESTIN_hex1480  DESTIN_hex1481  DESTIN_hex1484  DESTIN_hex1485  DESTIN_hex1486  
     -0.810611       -2.587971       -0.934893       -0.617190        0.708782  
DESTIN_hex1487  DESTIN_hex1488  DESTIN_hex1489  DESTIN_hex1491  DESTIN_hex1492  
     -0.945054       -1.931375       -0.546072       -1.396215       -0.393619  
DESTIN_hex1493  DESTIN_hex1494  DESTIN_hex1495  DESTIN_hex1496  DESTIN_hex1497  
     -1.127898        1.858745       -1.147087       -0.745489       -1.659461  
DESTIN_hex1499  DESTIN_hex1500  DESTIN_hex1501  DESTIN_hex1502  DESTIN_hex1503  
     -1.121160       -1.508867       -0.902250        0.640477       -2.739814  
DESTIN_hex1504  DESTIN_hex1506  DESTIN_hex1507  DESTIN_hex1508  DESTIN_hex1509  
     -0.381068       -1.048943        1.228320        0.876308       -1.292845  
DESTIN_hex1510  DESTIN_hex1511  DESTIN_hex1513  DESTIN_hex1514  DESTIN_hex1515  
     -1.298504        1.667095       -0.823532       -1.033630        1.040498  
DESTIN_hex1516  DESTIN_hex1517  DESTIN_hex1518  DESTIN_hex1522  DESTIN_hex1523  
      0.032889        0.791694       -1.338887       -1.826134       -0.491926  
DESTIN_hex1524  DESTIN_hex1525  DESTIN_hex1528  DESTIN_hex1529  DESTIN_hex1530  
     -1.145420       -0.654614        0.180800       -0.962139       -0.101159  
DESTIN_hex1531  DESTIN_hex1532  DESTIN_hex1534  DESTIN_hex1535  DESTIN_hex1536  
     -0.328821       -1.498652       -1.381550        0.627064       -0.502396  
DESTIN_hex1537  DESTIN_hex1538  DESTIN_hex1540  DESTIN_hex1541  DESTIN_hex1542  
     -0.831358       -0.825101        1.111700       -0.708465       -0.341168  
DESTIN_hex1543  DESTIN_hex1544  DESTIN_hex1546  DESTIN_hex1547  DESTIN_hex1548  
     -0.606940       -2.000755        1.147585       -1.858561        0.706459  
DESTIN_hex1549  DESTIN_hex1550  DESTIN_hex1551  DESTIN_hex1553  DESTIN_hex1554  
     -1.935275        0.256976       -0.912716        1.359094        0.975123  
DESTIN_hex1555  DESTIN_hex1556  DESTIN_hex1557  DESTIN_hex1563  DESTIN_hex1564  
     -0.974662       -1.431716        0.907818       -1.635899       -0.909504  
DESTIN_hex1565  DESTIN_hex1570  DESTIN_hex1571  DESTIN_hex1572  DESTIN_hex1575  
     -0.350175       -0.187507       -1.566796       -1.021091        0.949570  
DESTIN_hex1579  DESTIN_hex1583  DESTIN_hex1584  DESTIN_hex1587  DESTIN_hex1588  
     -0.755174       -1.509938        1.255164       -0.149198        0.490300  
DESTIN_hex1592  DESTIN_hex1594  DESTIN_hex1602  DESTIN_hex1603  DESTIN_hex1608  
      1.482876       -0.729626       -2.850976       -1.101575        1.970379  
DESTIN_hex1609  DESTIN_hex1616  DESTIN_hex1623  DESTIN_hex1630  DESTIN_hex1643  
      1.545360        0.222512        1.862799       -1.140616       -2.955193  
DESTIN_hex1644  DESTIN_hex1665            dist  
      1.474527        0.574490       -1.719430  

Degrees of Freedom: 51925 Total (i.e. Null);  50333 Residual
Null Deviance:      73540000 
Residual Deviance: 19840000     AIC: 20110000

Now that we have fit three different spatial interaction models, we will now save the fitted values resulted from each model into a new dataset called fitted_flow_weekday_morn. These fitted values represent the estimated flows from each model.

orcSIM_fitted <- as.data.frame(orcSIM_weekday_morn$fitted.values)
colnames(orcSIM_fitted) <- "ORCEstimatedFlow"
fitted_flow_weekday_morn <- cbind(flow_data_weekday_morn,orcSIM_fitted)

desSIM_fitted <- as.data.frame(desSIM_weekday_morn$fitted.values)
colnames(desSIM_fitted) <- "DESEstimatedFlow"
fitted_flow_weekday_morn <- cbind(fitted_flow_weekday_morn,desSIM_fitted)

dbcSIM_fitted <- as.data.frame(dbcSIM_weekday_morn$fitted.values)
colnames(dbcSIM_fitted) <- "DBCEstimatedFlow"
fitted_flow_weekday_morn <- cbind(fitted_flow_weekday_morn,dbcSIM_fitted)

4.10 Original Constraint Flow Estimation Map

Looking at the model outputs above, the results are not intuitive enough for users, especially those without background to understand and interpret. In this session, we will test and try different visualization approaches to better present the model results.

particularly, we are interested to test a R package called stplanr which provides functions for transport modelling such as creating geographic “desire lines” from origin-destination data.

pacman::p_load(stplanr)

Desire lines are a powerful tool for visualizing the flow of movement between different locations. However, they are not suitable for visualizing intra-regional movements, where both the origin and destination belong to a single spatial unit. Therefore, we need to filter out intra-regional trajectories from our dataset first.

od_plot <- fitted_flow_weekday_morn[fitted_flow_weekday_morn$ORIGIN_hex!=fitted_flow_weekday_morn$DESTIN_hex,]

Next, we will create a flowLine object which compiles all the desire lines from our dataset. This is done using the od2line() function from the stplanr package.

flowLine <- od2line(flow = od_plot, 
                    zones = hex_grid_pa_sz,
                    zone_code = "index")
flowLine <- st_join(flowLine, hex_grid_pa_sz,by = "index")

Next, we will filter out the desire lines with flow volume less than 5000. This is to ensure that we only visualize the most significant flow lines.

Reflection

Prototyping Thoughts

During the initial stages of my prototyping, I hadn’t considered the idea of filtering the desire lines based on flow volume. However, as I iterated and refined my approach, I realized that having too many lines on a single map could potentially limit its interpretability, making it difficult to discern meaningful patterns. This led me to the conclusion that it might be more effective to focus on flows with significant volume. By doing so, I could reduce the clutter and make the map more readable, allowing for a more detailed and focused analysis.

orc_flowLine <- flowLine %>% filter(ORCEstimatedFlow > 5000)

Next, we will generate maps for inflow and outflow, akin to our previous approach. However, this time, we will utilize the fitted values derived from the Origin Constrained SIM model. The process involves aggregating the dataset based on either the ORIGIN_hex or DESTIN_hex. Subsequently, we will integrate this aggregated data with the hexagonal grid data for visualization purposes.

orc_fitted_inflow <- aggregate(fitted_flow_weekday_morn$ORCEstimatedFlow, by=list(Category=fitted_flow_weekday_morn$DESTIN_hex), FUN=sum)
colnames(orc_fitted_inflow) <- c("index", "Estimated_InFlow")
orc_fitted_inflow_hex <- left_join(hex_grid_pa_sz, orc_fitted_inflow, by = 'index')
orc_fitted_inflow_hex$Estimated_InFlow <- ifelse(is.na(orc_fitted_inflow_hex$Estimated_InFlow), 0, orc_fitted_inflow_hex$Estimated_InFlow)

orc_fitted_outflow <- aggregate(fitted_flow_weekday_morn$ORCEstimatedFlow, by=list(Category=fitted_flow_weekday_morn$ORIGIN_hex), FUN=sum)
colnames(orc_fitted_outflow) <- c("index", "Estimated_OutFlow")
orc_fitted_outflow_hex <- left_join(hex_grid_pa_sz, orc_fitted_outflow, by = 'index')
orc_fitted_outflow_hex$Estimated_OutFlow <- ifelse(is.na(orc_fitted_outflow_hex$Estimated_OutFlow), 0, orc_fitted_outflow_hex$Estimated_OutFlow)

Finally, we will use the appropriate tmap functions to create an interactive map with four layers. Each layer serves a unique purpose and adds a different dimension to our visualization.

  1. hex_grid_pa_sz: This layer serves as the base map for the analytical hexagons used in our modeling. It forms the foundation upon which we’ll overlay our desire lines and other data.

  2. orc_fitted_inflow_hex: This layer represents the estimated volume of inflow for each hexagonal unit, as determined by our Origin Constrained Spatial Interaction Model (SIM). It will give us a visual representation of where people are coming from.

  3. orc_fitted_outflow_hex: Similarly, this layer represents the estimated volume of outflow for each hexagonal unit, also based on our Origin Constrained SIM. This will help us understand where people are going.

  4. orc_flowLine: This layer represents the estimated desire lines resulting from our Origin Constrained SIM. These lines will be represented in differing colors and line widths based on trip volume, providing a visual representation of the flow between different hexagons.

tmap_mode("view")
tm_shape(hex_grid_pa_sz) +
  tm_fill(col="#f2ffff",
          id = "PLN_AREA_N") +
  tm_borders(col = "grey") +
tm_shape(orc_fitted_inflow_hex) +
  tm_fill(col = "Estimated_InFlow",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Estimated Inflow Volume",
          id = "Estimated_InFlow")+
  tm_borders(col = "grey") +
tm_shape(orc_fitted_outflow_hex) +
  tm_fill(col = "Estimated_OutFlow",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Estimated Outflow Volume",
          id = "Estimated_OutFlow")+
  tm_borders(col = "grey") +
tm_shape(orc_flowLine) +
  tm_lines(lwd = "ORCEstimatedFlow",
           col = "ORCEstimatedFlow",
           palette = c("#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "pretty",
          scale = c(1,2,3,4,5,7,9),
          n = 6,
          title.lwd = "Orgin Constrained Flow",
          id = "ORCEstimatedFlow")
Reflection

Prototyping Thoughts

During my prototyping process, I’ve been considering the user experience quite a bit. Even though I’ve overlaid all four layers in the current stage, I’m contemplating a more interactive approach for our Shiny application by allowing them to choose the layers they want to see. They could select one layer at a time or any combination of layers, depending on what they’re interested in. This way, they can customize the map to their preferences and focus on the data that’s most relevant to them.

This approach would not only make the application more interactive but also more user-friendly. Users could explore different layers at their own pace, delve deeper into the ones they find interesting, and ultimately gain a more personalized understanding of the data.

4.11 Destination Constraint Flow Estimation Map

Similar to what we did with origin constrained SIM model, we will follow the same procedure for plotting destination constrained SIM model results.

des_flowLine <- flowLine %>% filter(DESEstimatedFlow > 5000)
des_fitted_inflow <- aggregate(fitted_flow_weekday_morn$DESEstimatedFlow, by=list(Category=fitted_flow_weekday_morn$DESTIN_hex), FUN=sum)
colnames(des_fitted_inflow) <- c("index", "Estimated_InFlow")
des_fitted_inflow_hex <- left_join(hex_grid_pa_sz, des_fitted_inflow, by = 'index')
des_fitted_inflow_hex$Estimated_InFlow <- ifelse(is.na(des_fitted_inflow_hex$Estimated_InFlow), 0, des_fitted_inflow_hex$Estimated_InFlow)

des_fitted_outflow <- aggregate(fitted_flow_weekday_morn$DESEstimatedFlow, by=list(Category=fitted_flow_weekday_morn$ORIGIN_hex), FUN=sum)
colnames(des_fitted_outflow) <- c("index", "Estimated_OutFlow")
des_fitted_outflow_hex <- left_join(hex_grid_pa_sz, des_fitted_outflow, by = 'index')
des_fitted_outflow_hex$Estimated_OutFlow <- ifelse(is.na(des_fitted_outflow_hex$Estimated_OutFlow), 0, des_fitted_outflow_hex$Estimated_OutFlow)
tmap_mode("view")
tm_shape(hex_grid_pa_sz) +
  tm_fill(col="#f2ffff",
          id = "PLN_AREA_N") +
  tm_borders(col = "grey") +
tm_shape(des_fitted_inflow_hex) +
  tm_fill(col = "Estimated_InFlow",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Estimated Inflow Volume",
          id = "Estimated_InFlow")+
  tm_borders(col = "grey") +
tm_shape(des_fitted_outflow_hex) +
  tm_fill(col = "Estimated_OutFlow",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Estimated Outflow Volume",
          id = "Estimated_OutFlow")+
  tm_borders(col = "grey") +
tm_shape(orc_flowLine) +
  tm_lines(lwd = "DESEstimatedFlow",
           col = "DESEstimatedFlow",
           palette = c("#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "pretty",
          scale = c(1,2,3,4,5,7,9),
          n = 6,
          title.lwd = "Destination Constrained Flow",
          id = "DESEstimatedFlow")

4.12 Doubly Constraint Flow Estimation Map

Similar to what we did with origin constrained SIM model, we will follow the same procedure for plotting doubly constrained SIM model results.

dbc_flowLine <- flowLine %>% filter(DBCEstimatedFlow > 5000)
dbc_fitted_inflow <- aggregate(fitted_flow_weekday_morn$DBCEstimatedFlow, by=list(Category=fitted_flow_weekday_morn$DESTIN_hex), FUN=sum)
colnames(dbc_fitted_inflow) <- c("index", "Estimated_InFlow")
dbc_fitted_inflow_hex <- left_join(hex_grid_pa_sz, orc_fitted_inflow, by = 'index')
dbc_fitted_inflow_hex$Estimated_InFlow <- ifelse(is.na(dbc_fitted_inflow_hex$Estimated_InFlow), 0, dbc_fitted_inflow_hex$Estimated_InFlow)

dbc_fitted_outflow <- aggregate(fitted_flow_weekday_morn$DBCEstimatedFlow, by=list(Category=fitted_flow_weekday_morn$ORIGIN_hex), FUN=sum)
colnames(dbc_fitted_outflow) <- c("index", "Estimated_OutFlow")
dbc_fitted_outflow_hex <- left_join(hex_grid_pa_sz, orc_fitted_outflow, by = 'index')
dbc_fitted_outflow_hex$Estimated_OutFlow <- ifelse(is.na(dbc_fitted_outflow_hex$Estimated_OutFlow), 0, dbc_fitted_outflow_hex$Estimated_OutFlow)
tmap_mode("view")
tm_shape(hex_grid_pa_sz) +
  tm_fill(col="#f2ffff",
          id = "PLN_AREA_N") +
  tm_borders(col = "grey") +
tm_shape(dbc_fitted_inflow_hex) +
  tm_fill(col = "Estimated_InFlow",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Estimated Inflow Volume",
          id = "Estimated_InFlow")+
  tm_borders(col = "grey") +
tm_shape(dbc_fitted_outflow_hex) +
  tm_fill(col = "Estimated_OutFlow",
          palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "fixed",
          breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
          title = "Estimated Outflow Volume",
          id = "Estimated_OutFlow")+
  tm_borders(col = "grey") +
tm_shape(orc_flowLine) +
  tm_lines(lwd = "DBCEstimatedFlow",
           col = "DBCEstimatedFlow",
           palette = c("#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
          style = "pretty",
          scale = c(1,2,3,4,5,7,9),
          n = 6,
          title.lwd = "Destination Constrained Flow",
          id = "DBCEstimatedFlow")
Reflection

Prototyping Thoughts

During my prototyping process, I spent some time to think about the organization of the models. Initially, I considered having a separate tabset for each model type. However, upon reflection, I believe it might be more beneficial to have the model type as one of the calibration inputs and combine everything on one page. The advantage of this approach is that it allows users to stack layers not just from one model, but across different models as well. For instance, they could stack desire flows from all three models and analyze the differences in the results. This would be challenging if we have each tabset for each model than the user will have to keep swtiching from one tab to another just to compare the results.

4.13 Zooming to Specific Planning Area & Subzones

Similar to what we did in earlier sections, we can also create planning area and subzone specific maps. In the following example, I tried to prototype using destination constrained SIM model.

Reflection

Prototyping Thoughts

For the purpose of prototyping, I’ve been using the destination constrained Spatial Interaction Model (SIM). However, in the actual Shiny application, I plan to give users the flexibility to choose both the model type and the planning/area or subzone they want to use for their analysis.

Additionally, I’m considering allowing users to specify the time period they’re interested in - whether it’s the morning or evening peak, or weekday or weekend/holiday. However, in this exercise we are only using weekday morning dataset, it is not possible to do it here. But the actual application will be designed to handle different time periods.

des_flowLine_map_pa <- function(pa_input){
  des_flowLine_temp <- flowLine %>% filter(PLN_AREA_N == pa_input, DBCEstimatedFlow > 1000)
  des_fitted_inflow_hex <- des_fitted_inflow_hex %>% filter(PLN_AREA_N == pa_input)
  des_fitted_outflow_hex <- des_fitted_outflow_hex %>% filter(PLN_AREA_N == pa_input)

  
  tmap_mode("view")
  tm_shape(hex_grid_pa_sz) +
    tm_fill(col="#f2ffff") +
    tm_borders(col = "grey") +
  tm_shape(des_fitted_inflow_hex) +
    tm_fill(col = "Estimated_InFlow",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
            style = "fixed",
            breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
            title = "Estimated Inflow Volume",
          id = "Estimated_InFlow")+
    tm_borders(col = "grey") +
  tm_shape(des_fitted_outflow_hex) +
    tm_fill(col = "Estimated_OutFlow",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
            style = "fixed",
            breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
            title = "Estimated Outflow Volume",
          id = "Estimated_OutFlow")+
    tm_borders(col = "grey") +
  tm_shape(des_flowLine_temp) +
    tm_lines(lwd = "DESEstimatedFlow",
             col = "DESEstimatedFlow",
             palette = c("#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
            style = "pretty",
            scale = c(1,2,3,4,5,7,9),
            n = 6,
            title.lwd = "Destination Constrained Flow",
            id = "DESEstimatedFlow")
}
des_flowLine_map_sz <- function(sz_input){
  des_flowLine_temp <- flowLine %>% filter(SUBZONE_N == sz_input, DBCEstimatedFlow > 1000)
  des_fitted_inflow_hex <- des_fitted_inflow_hex %>% filter(SUBZONE_N == sz_input)
  des_fitted_outflow_hex <- des_fitted_outflow_hex %>% filter(SUBZONE_N == sz_input)
  
  tmap_mode("view")
  tm_shape(hex_grid_pa_sz) +
    tm_fill(col="#f2ffff") +
    tm_borders(col = "grey") +
  tm_shape(des_fitted_inflow_hex) +
    tm_fill(col = "Estimated_InFlow",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
            style = "fixed",
            breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
            title = "Estimated Inflow Volume",
          id = "Estimated_InFlow")+
    tm_borders(col = "grey") +
  tm_shape(des_fitted_outflow_hex) +
    tm_fill(col = "Estimated_OutFlow",
            palette = c("#f2ffff","#f9f777","#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
            style = "fixed",
            breaks = c(0,1,100,1000,10000,100000,500000,1000000,5000000),
            title = "Estimated Outflow Volume",
          id = "Estimated_OutFlow")+
    tm_borders(col = "grey") +
  tm_shape(des_flowLine_temp) +
    tm_lines(lwd = "DESEstimatedFlow",
             col = "DESEstimatedFlow",
             palette = c("#f8d673","#f89974","#D66779","#b977cb","#7977f3","#57bfc0"),
            style = "pretty",
            scale = c(1,2,3,4,5,7,9),
            n = 6,
            title.lwd = "Destination Constrained Flow",
            id = "DESEstimatedFlow")
}
Reflection

Prototyping Thoughts

During my prototyping process, I’ve made an adjustment to the filtering based on flow volume. Initially, I was filtering out data with a flow volume less than 5000. However, I realized that some subzones and planning areas might have a lower flow volume, which could lead to errors if the maximum flow is less than this threshold filter.

To avoid such errors, I decided to reduce the threshold to 1000. This allows for a more inclusive analysis, capturing data from areas with lower flow volumes. However, I’m aware that there could still be instances where the flow is even less than 1000, which could still potentially lead to errors.

While I haven’t addressed this issue in the current stage, I’m actively thinking about ways to handle this in the final Shiny app.

As a demonstration, we call the des_flowLine_map_pa() function with “WOODLANDS” and the des_flowLine_map_sz() function with “NATURE RESERVE” as inputs. to test whether the functions works well and produce desired outcomes.

des_flowLine_map_pa("WOODLANDS")
des_flowLine_map_sz("NATURE RESERVE")

4.14 Push-Pull Factors

Beyond looking at the estimated flow volumes, spatial interaction modelling also offers valuable insights by providing coefficient estimates for explanatory variables, both at the origin and destination locations.

  • In particular, the origin-constrained SIM is instrumental in identifying the ‘pull’ factors of the destination. These factors represent conditions or circumstances that draw people from multiple origins towards the destination.

  • Conversely, the destination-constrained SIM sheds light on the ‘push’ factors at the origin. These factors represent conditions or circumstances that encourage people to leave the origin and move to multiple destinations.

Looking at the coefficient estimates of these push-pull factors, we can find correlation between the flow volume and the increase or decrease in the value of these factors.

To do visualisations and analysis with push-pull factors, we will first extract fitted coefficient values from origin-constrained and destination-constrained SIM models first.

pull_factors <- tibble::rownames_to_column(as.data.frame(orcSIM_weekday_morn$coefficients), "factors")
colnames(pull_factors) <- c("factors", "coefficients")
pull_factors <- pull_factors[grep("^(d_)", pull_factors$factors), ]
push_factors <- tibble::rownames_to_column(as.data.frame(desSIM_weekday_morn$coefficients), "factors")
colnames(push_factors) <- c("factors", "coefficients")
push_factors <- push_factors[grep("^(o_)", push_factors$factors), ]

Let’s look at the data a bit.

pull_factors$factors
 [1] "d_biz_count"           "d_school_count"        "d_fin_count"          
 [4] "d_hc_count"            "d_busstop_count"       "d_housing_count"      
 [7] "d_leisure_recre_count" "d_retail_count"        "d_entertn_count"      
[10] "d_food_bev_count"     
Reflection

Prototyping Thoughts

During my prototyping process, I’ve come to realize the importance of clarity and interpretability. It’s not just about presenting the data, but also about making it understandable and meaningful to the user.

While I understand what each of these factor values means, it may not be as clear for everyone else. Especially without the context of the data, terms like d_hc_count can be confusing - and we cannot assume that they will know hc refers to healthcare!

With this in mind, I’ve decided to update these values to be more explicit and straightforward. Instead of using abbreviations, I’ll use clear, descriptive names that accurately represent what each value stands for. This way, users can easily understand what they’re looking at, making the application more user-friendly and informative.

We will now update the factors values in pull_factors dataset from abbreviations to long form as below.

pull_factors$factors <- c("Business", "School", "Financial Institute","Healthcare","Bus Stop", "Housing", "Leisure/Recreation", "Retail", "Entertainment", "Food & Beverages")
push_factors$factors
 [1] "o_biz_count"           "o_school_count"        "o_fin_count"          
 [4] "o_hc_count"            "o_busstop_count"       "o_housing_count"      
 [7] "o_leisure_recre_count" "o_retail_count"        "o_entertn_count"      
[10] "o_food_bev_count"     

We will do the same for factors values in push_factors dataset.

push_factors$factors <- c("Business", "School", "Financial Institute","Healthcare","Bus Stop", "Housing", "Leisure/Recreation", "Retail", "Entertainment", "Food & Beverages")

Now that we have prepared all the data, we will plot bar graphs using relevant ggplot2 functions.

ggplot(data = pull_factors,
       aes(x = coefficients,
           y = reorder(factors, coefficients),
       fill = factors)) +
  geom_bar(stat="identity", show.legend = FALSE) +
  xlab("Coefficient Estimate") +
  ylab("Pull Factors of Destination")

ggplot(data = push_factors,
       aes(x = coefficients,
           y = reorder(factors, coefficients),
       fill = factors)) +
  geom_bar(stat="identity", show.legend = FALSE) +
  xlab("Coefficient Estimate") +
  ylab("Push Factors of Origin")

Reflection

Prototyping Thoughts

Visualizing the coefficient estimates using bar graphs, instead of simple tables, indeed enhances interpretability. It provides a clear picture of not only the magnitude (absolute value) but also the direction (positive or negative) of each coefficient estimate.

For example, in push factor graph above, we can clearly see that an increase in business establishments corresponds to a decrease in pushing people away, indicating that areas with more businesses tend to attract more people. On the other hand, an increase in financial institutes corresponds to an increase in pushing people away, suggesting that areas with more financial institutes might be less attractive for some reason.

This kind of visual representation makes it much easier to understand and interpret the results of the analysis.

4.15 Exploring User Input Options for Shiny Application

Reflection on what we explored in the exercise above, we will use two tabset - Flow Estimation Map and Push-Pull Factors to visualise the results.

4.15.1 Flow Estimation Map

For Flow Estimation Map tabset, we may include the following user specification and model calibration options for our Shiny application.

Input Options
Model Type Origin-Constrained, Destination-Constrained, Doubly Constrained
Time Period Weekday - Morning , Weekday - Evening, Weekend/Holiday - Morning, Weekend/Holiday - Evening
Result Layer O-D Desire Line, Fitted Inflow Map, Fitted Outflow Map
Zooming Level Overall (Singapore) , Planning Area, Subzone
Area of Interest
  • NA if Overall (Singapore) is selected for Zooming Level

  • Planning Area Name if Planning Area is selected for Zooming Level

  • Subzone Name if Subzone is selected for Zooming Level

Below is a rough outline of how the user interface for this tabset might look like.

4.15.1 Push-Pull Factors

For Push-Pull Factors tabset, we may include the following user specification and model calibration options for our Shiny application. Note that we remove the specification for Model Type as push-pull factors cannot be derived from a single SIM model.

Input Options
Time Period Weekday - Morning , Weekday - Evening, Weekend/Holiday - Morning, Weekend/Holiday - Evening
Zooming Level Overall (Singapore) , Planning Area, Subzone
Area of Interest
  • NA if Overall (Singapore) is selected for Zooming Level

  • Planning Area Name if Planning Area is selected for Zooming Level

  • Subzone Name if Subzone is selected for Zooming Level

Below is a rough outline of how the user interface for this tabset might look like.

4.16 Comparing Estimated Flows from Different Models

In this section, we are comparing the performance of the three Spatial Interaction Models (SIMs) we have fitted above: the origin constrained SIM, the destination constrained SIM, and the doubly constrained SIM. To achieve it, we will explore an R packaged called performance which provides functions for assessment of model quality and performance.

pacman::p_load(performance)

Firstly, we will a list of the three models we have fitted: the origin constrained SIM (orcSIM_weekday_morn), the destination constrained SIM (desSIM_weekday_morn), and the doubly constrained SIM (dbcSIM_weekday_morn).

We will then use the compare_performance function to compare the models based on the RMSE. The RMSE is a measure of the differences between the values predicted by a model and the values actually observed.

model_list <- list(originConstrained=orcSIM_weekday_morn,
                   destinConstrained=desSIM_weekday_morn,
                   doublyConstrained=dbcSIM_weekday_morn)

compare_performance(model_list, metrics = "RMSE")
# Comparison of Model Performance Indices

Name              | Model |     RMSE
------------------------------------
originConstrained |   glm | 1498.442
destinConstrained |   glm | 1468.283
doublyConstrained |   glm | 1137.973

Next, we will create scatter plots to compare the observed flows against the estimated flows from each model.

ggplot(data = fitted_flow_weekday_morn,
                aes(x = ORCEstimatedFlow,
                    y = TOTAL_TRIPS)) +
  geom_point() +
  geom_smooth(method = lm) +
  coord_cartesian(xlim=c(0,100000),
                  ylim=c(0,100000)) + 
  labs(title = "Observed vs. Fitted Values for Origin Constrained SIM",
       x = "Fitted Values", y = "Observed Values")

ggplot(data = fitted_flow_weekday_morn,
                aes(x = DESEstimatedFlow,
                    y = TOTAL_TRIPS)) +
  geom_point() +
  geom_smooth(method = lm) +
  coord_cartesian(xlim=c(0,100000),
                  ylim=c(0,100000)) + 
  labs(title = "Observed vs. Fitted Values for Destination Constrained SIM",
       x = "Fitted Values", y = "Observed Values")

ggplot(data = fitted_flow_weekday_morn,
                aes(x = DBCEstimatedFlow,
                    y = TOTAL_TRIPS)) +
  geom_point() +
  geom_smooth(method = lm) +
  coord_cartesian(xlim=c(0,100000),
                  ylim=c(0,100000)) + 
  labs(title = "Observed vs. Fitted Values for Doubly Constrained SIM",
       x = "Fitted Values", y = "Observed Values")

Reflection

Prototyping Thoughts

As I’ve been working on the prototyping process, I’ve had some thoughts on whether or not to add the section on model comparison. While observed vs fitted value plots are essential in research for validating models, I realized they might not be as relevant or intuitive for everyone when used in a geospatial application. Given that the users of our Shiny application may not have a research background, such plots could potentially confuse them. Therefore, I’ve decided to focus on features that enhance the interpretability and usability of the application.

5.0 Proposed Shiny Application User Interface Storyboard

Below, I’m excited to present the finalized mock-up storyboard of the Shiny Application. I have focused on three specific tabsets that I have tested and explored throughout this exercise - Inflow/Outflow Map, Flow Estimation Map, and Push/Pull Factors. Not only will I present the user interface layout, but I will also show how different outputs would look like based on various user calibration inputs.

5.1 Inflow/Outflow Map

5.1.1 Inflow/Outflow Map for Singapore Overall

Inflow/Outflow Map - (Flow Type) Incoming Flow, (Time Period) Weekday - Morning, (Zooming Level) - Overall Singapore, (Area of Interest) NA

Inflow/Outflow Map - (Flow Type) Outgoing Flow, (Time Period) Weekday - Morning, (Zooming Level) - Overall Singapore, (Area of Interest) NA

5.1.2 Inflow/Outflow Map for Planning Area/Subzone Zooming

Inflow/Outflow Map - (Flow Type) Incoming Flow, (Time Period) Weekday - Morning, (Zooming Level) - Planning Area, (Area of Interest) Bukit Panjang

Inflow/Outflow Map - (Flow Type) Incoming Flow, (Time Period) Weekday - Morning, (Zooming Level) - Subzone, (Area of Interest) Changi Airport

Inflow/Outflow Map - (Flow Type) Outgoing Flow, (Time Period) Weekday - Morning, (Zooming Level) - Subzone, (Area of Interest) Tuas North

5.2 Flow Estimation Map

5.2.1 Origin-Constrained Flow Estimation Maps

Flow Estimation Map - (Model Type) Origin-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line, Fitted Outflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Origin-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Origin-Constrained, (Time Period) Weekday - Morning, (Result Layer) [Fitted Outflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Origin-Constrained, (Time Period) Weekday - Morning, (Result Layer) [Fitted Inflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

5.2.2 Destination-Constrained Flow Estimation Maps

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line, Fitted Inflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line, Fitted Inflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [Fitted Outflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

5.2.3 Doubly-Constrained Flow Estimation Maps

Flow Estimation Map - (Model Type) Doubly-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line, Fitted Inflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Doubly-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line], (Zooming Level) Overall Singapore, (Area of Interest) NA

Flow Estimation Map - (Model Type) Doubly-Constrained, (Time Period) Weekday - Morning, (Result Layer) [Fitted Outflow Map], (Zooming Level) Overall Singapore, (Area of Interest) NA

5.2.4 Flow Estimation Maps for Planning Area/Subzone Zooming

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line, Fitted Inflow Map, Fitted Outflow Map], (Zooming Level) Planning Area, (Area of Interest) Woodlands

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [Fitted Inflow Map], (Zooming Level) Planning Area, (Area of Interest) Woodlands

Flow Estimation Map - (Model Type) Destination-Constrained, (Time Period) Weekday - Morning, (Result Layer) [O-D Desire Line], (Zooming Level) Subzone, (Area of Interest) Tuas North

5.3 Push-Pull Factors

Push-Pull Factors - (Time Period) Weekday - Morning, (Zooming Level) Overall Singapore, (Area of Interest) NA

6.0 Conclusion

Transitioning from research-oriented tasks to an analytical application, as required in this exercise, presented a unique set of challenges. Instead of focusing on the components of research studies, I shifted my attention to the elements of a typical data dashboard and the user's perception of the information presented therein. This exercise, while demanding, provided a valuable opportunity for learning through trial and error, significantly enhancing my data visualization skills.